User tests: Successful: Unsuccessful:
because some IDEs (SublimeText) get confused.
This regexp is a bit confusing but it's mean to work like this:
Inside the []
, the first \
(PHP string) escapes the second one and the third is literal. So this give us regexp like /(^|[^\\])D/
in which the first one again (regexp) escapes the second one.
Unfortunately, SublimeText (and maybe other editors) misinterpret the meaning of the third \
. Of course they are wrong and I don't think it's a great idea to write code to appeal to wrongly behaving editors but I don't think there's any harm in this minor change. What will happen now is that the third \
, instead of being literal, will escape the fourth one and we will still end up with a regexp like /(^|[^\\])D/
. So there should be no change to functionality whatsoever.
The related item on the issue tracker has been closed as not joomla core
Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31808&start=0