W
Wes Gamble
I would like to write a regexp that will match a string that does NOT
start with a specified set of characters.
For example,
Given:
xyz123
asldfhsl
xyk2345
and assume that I want to see only strings that don't start with "xyz"
(so in this case, the last 2 in the list).
I tried /^[^(xyz)]/ but I don't trust it. I don't think the grouping
will take inside the character class.
Do I need a negative lookahead assertion?
Thanks,
Wes
start with a specified set of characters.
For example,
Given:
xyz123
asldfhsl
xyk2345
and assume that I want to see only strings that don't start with "xyz"
(so in this case, the last 2 in the list).
I tried /^[^(xyz)]/ but I don't trust it. I don't think the grouping
will take inside the character class.
Do I need a negative lookahead assertion?
Thanks,
Wes