Using rubular.com as a guide, I am trying to get this expression to work correctly.
^((move|travel|fly) (.+) pixels)
Basically, this matches
move 5 pixels
fly 10 pixels
travel 3 pixels
The matches I get are:
-
move 5 pixels
-
move
-
5
The problem is that I don’t want to return the matches for the options. Is there some way to match the regular expression but not return the match for those in that option?
Ideally it would be:
-
move 5 pixels
-
5
Thanks in advanced!
Use a non-capturing group:
See it working online: rubular