Hi vimmers,
When searching through text files using regex, I am
trying
unsuccessfully to negated a complicated pattern
without success.
What doesn't help is the double usage of the
circumflex ^ character
(may also be called caret, not sure), because it also
means start of a
line.
However when used within square brackets, it negates
the character in
front of it. i.e. [^p] finds anything that is not p.
[^aeiou] finds
anything that is not a lower case vowel. That's all
well and good but when
you have a sequence (usually grouped) you're trying to
negate, simple
obvious approaches have not worked.
if you want to find anything that is not any word
ending in "ion",
well the regex group you're looking at is
\(\<.\+ion\>\), but how do you
negate that? Put it all in square brackets and provide
a caret ^ at the
beginning? Nope. in fact group within square brackets
doesn't work as
might be expected. Th enegation pretty much seems to
be built for single
character negation only, not sequences.
I'm only referrign to searching here, when it comes to
substituting or
deleting, :v/etc/d seems tailor nmade to help with
negations of tricky
regex.
Has anybody else had this similar type of problem?
Have read the help
files, surprised to see nothing on this. Caret ^ is
mostly used in its
second sense, that of marking start of line.
Any help appreciated.
___________________________________________________________
Switch an email account to Yahoo! Mail, you could win FIFA World Cup tickets.
http://uk.mail.yahoo.com