Reputation: 34976
I've been stuck on an interesting (IE: mind numbing) question for the past few hours.
I've been trying to parse operators with regex:
([<>]=?|[!=]=)
The ones that I want are: <= >= < > == !=
==
and !=
matches great. But all the ones having to do with <
or >
doesn't on my Drupal site, even though they should theoretically work.
What I ended up doing is this: .replace(/more than/ig, ">")
And in the text write "more than
" where I would write >
, and it works! Matches perfectly and everything...
This is really really silly, but I cannot think of a reason why this issue would exist. I turned off all the filters in Drupal, and in Firebug just writing >
normally looks like >
, not escaped or anything.
I'm really confused and hope for enlightenment.
Thanks.
Upvotes: 1
Views: 2008
Reputation: 26979
Could something be changing your source material into entities?
> vs >
< vs <
Upvotes: 6
Reputation: 74985
Did you try actually matching the escaped version?
Firebug will not show the content escaped, i.e. it will not display >
as entities (>
) even though they are (view the source of this page to check that). It seems very likely that it is the problem.
Upvotes: 3