Skip to content

Commit

Permalink
Added concept of "letter"
Browse files Browse the repository at this point in the history
This makes (letter --> word) work in the same way as (digit --> integer).

Although the constructed regex will now be slightly different for anything containing words, this is fully backwards compatible.
  • Loading branch information
tom-lord committed Jun 3, 2014
1 parent ffab0d7 commit 37f4a4a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/verbal_expressions.rb
Expand Up @@ -71,9 +71,14 @@ def tab
add('\t')
end

# Any alphanumeric
# Any single alphanumeric
def letter
add('\w')
end

# Any word (multiple alphanumerics)
def word
add('\w+')
one_or_more { letter }
end

# Any single digit
Expand Down

0 comments on commit 37f4a4a

Please sign in to comment.