& Eacute; and & eacute;
I tried the following regular expression, but it does not return anything:
/^(?!&)(É)/
Any suggestions?
Use
/(?<=.)É/
(Assuming Ruby 1.9 because 1.8 does not support lookbehind)
Reason: Match any character except the newline character. Therefore, if the lookbehind assertion matches, we are not at the beginning of the line.
< p>I'm parsing a text file, looping through each line, and I'm having trouble finding regular expressions. Part of this parsing involves changes appearing, for example:
& Eacute; And & eacute;
I tried the following regular expression, but it does not return anything:
/^(?!&)(É ;)/
Any suggestions?
So you want to match & Eacute; only if it is not online at the beginning?
Use
/(?<=.)É/
(Assuming Ruby 1.9 because 1.8 does not support lookbehind)
Reason: Match any character except the newline character. Therefore, if the lookbehind assertion matches, we are not at the beginning of the line.
p>