Capture Replacement Group Doesn't Work in ExtendScript
I'm having a problem using capture replace groups in my Find/Change script. For example, I'm fixing missing hyphenation in phrases. I find "aim off points" using \b([Aa]im[ ]?off[ ]?point)([s]?) and replace it with aim-off point$2, which should give me "aim-off points" as my replacement. My find/replace works perfectly using FMs Find/Change panel (see below). When I try it in my script I get this result: aim off pointaim-off points$2. The $2 capture group searches for the plural of "points." In my script tester I am using this to mimic the FM Find/Change panel:
FindReplace ("\\b([Aa]im[ ]?off[ ]?point)([s]?)", "aim-off point$2"); I've searched the blogs, reviewed K. Daube's Find/Change PDF, and tried various syntax combinations, without luck. Any help much appreciated.

