ack (perl?) regexp matching lines where if is the first word
- by Gauthier
Hey.
I'm finally learning regexps, training with ack. I believe this uses perl regexp.
I want to match all lines where the first non-blank characters are if (<word> !, with any number of spaces in between the elements.
This is what I came up with:
^[ \t]*if *\(\w+ *!
It only nearly worked. ^[ \t]* is wrong, since it matches one or none…