[pmwiki-users] Fixme icon
5ko at 5ko.fr
Sat Jan 11 16:36:05 PST 2020
I wasn't clear enough -- yes it matches existing (:FIXME:) but in the
end nothing happens to it.
Like I said, lookbehind can only look for strings with the same length
and we cannot look behind for either "(:FIXME:)" 9 characters or "\t" 1
character in the same lookbehind expression (?<!...).
When it finds existing (:FIXME:) and replaces it with itself, it is a
way to keep it out of the way when it searches for the other cases.
There are always other ways to do something in RegEx but this one is
short and works.
On 12/01/2020 00:40, Robert Riebisch wrote:
>> Based on the cases you listed, you can use this pattern:
>> $ROEPatterns["/(\\(:FIXME:\\)|(?<![\t])\\bFIXME\\b)/"] = '(:FIXME:)';
> Works for me.
> Interestingly it doesn't work on <https://regex101.com/>.
> (:FIXME:) is still matched, although it should not.
> regex101 correctly identifies the negative lookbehind, probably doesn't
> really support it.
> (<https://regexr.com/> does not support negative lookbehind at all and
> notifies about that.)
More information about the pmwiki-users