Displaying 1 result from an estimated 1 matches for "eeeq".
Did you mean:
eee
2008 Jul 06
2
Regular expressions: bug or misunderstanding?
...writing
regular expressions involving backslashes which make everything I write
completely unreadable, so I'm going to change the problem for this
post: I will define E to be the escape character, and q to be the
quote; the gsub() call would leave
Eq
unchanged, but would change
EEq
to EEEq, etc.
The expression I have come up with after this change is
gsub( "((^|[^E])(EE)*)q", "\\1Eq", x)
i.e. "(start of line, or non-escape, followed by an even number of
escapes), all of which we call expression 1, followed by a quote, is
replaced by expression 1 followed...