This came up in the G3 Discord, as part of morpheus562's work on the Skills and Abilities mod.
Essentially, he wants to patch Narlen Darkwalk's dialogue in BGEE to allow monks and bars to take part in the previously thief-only quests. Narlen has two top-level states with these triggers:
Global("TalkedToNarlen","GLOBAL",0)
!InParty([0.0.0.THIEF_ALL])
and
Global("TalkedToNarlen","GLOBAL",0)
He wants to alter only the first trigger and not the second, so we tried this d code:
REPLACE_TRIGGER_TEXT NARLEN ~Global("TalkedToNarlen","GLOBAL",0)[ %TAB%%LNL%%MNL%%WNL%]*!~ ~Global("TalkedToNarlen","GLOBAL",0) !InParty([0.0.0.BARD_ALL]) !~
No matter what we tried, we couldn't get it to positively match the ! at the end. We tried several tricks to try and get it to work, but it only seems to match if you use a . there. Trying this in a COPY_EXISTING > DECOMPILE_AND_PATCH > REPLACE_TEXTUALLY has the same result which makes me suspect there's something going on in the regexp parser.