Hi, I need to find a regular expression I can use in AWK to match a string which does NOT contain a sub-string in a fixed position. The string must begin with a pattern, but then NOT contain the sub-string.
Here's an example - the string must not contain "XP" after "420" :
"420" - is ok
"420 " - is ok
"420XP" - is ok
"420AB" - is NOT ok
"420AC" - is ok
I think the answer might make use of "^" to negate a match with "XP" but I can't find the correct regular expression. If anyone can help, I'd be most grateful.
Cheers,
Phil
Here's an example - the string must not contain "XP" after "420" :
"420" - is ok
"420 " - is ok
"420XP" - is ok
"420AB" - is NOT ok
"420AC" - is ok
I think the answer might make use of "^" to negate a match with "XP" but I can't find the correct regular expression. If anyone can help, I'd be most grateful.
Cheers,
Phil