Method: Rex::Text.to_words
- Defined in:
- lib/rex/text.rb
.to_words(str, strict = false) ⇒ Object
Returns the words in str as an Array.
strict - include only words, no boundary characters (like spaces, etc.)
453 454 455 456 457 |
# File 'lib/rex/text.rb', line 453 def self.to_words( str, strict = false ) splits = str.split( /\b/ ) splits.reject! { |w| !(w =~ /\w/) } if strict splits end |