Replace Exact misparses $ in Replace with

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 987
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Replace Exact misparses $ in Replace with

Post by dfhtextpipe »

The following subfilter reports an error:

Code: Select all

Replace [$$$Matthew 0:0\r\n] with [$$$[ Testament 2 Heading ]\r\n\r\n$$$Matthew 0:0\r\n]
   [X] Match case
   [ ] Whole words only
   [ ] Case sensitive replace
   [ ] Prompt on replace
   [ ] Skip prompt if identical
   [ ] First only
   [ ] Extract matches
 
The logged error message is

Code: Select all

2012-02-13 13:39:05,Error,$M is not a valid subexpression identifier for this pattern.
The maximum allowed subexpression identifier is $0 (or escape the $ sign using '$$')
Surely $n variables are only applicable for Perl patterns, not for Replace Exact ?

David
David
dfhtextpipe
Posts: 987
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Replace Exact misparses $ in Replace with

Post by dfhtextpipe »

A workaround is to double up the $ characters in the replace with:

Code: Select all

Replace [$$$Matthew 0:0\r\n] with [$$$$$$[ Testament 2 Heading ]\r\n\r\n$$$$$$Matthew 0:0\r\n]
   [X] Match case
   [ ] Whole words only
   [ ] Case sensitive replace
   [ ] Prompt on replace
   [ ] Skip prompt if identical
   [ ] First only
   [ ] Extract matches
 
IMHO, Such doubling of special matching characters should only be required for Perl pattern replacements!
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace Exact misparses $ in Replace with

Post by DataMystic Support »

It was designed to allow replacing an exact match with extra text, using the same case as the original text.

If you right-click the field, you can escape these very easily.
dfhtextpipe
Posts: 987
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Replace Exact misparses $ in Replace with

Post by dfhtextpipe »

Thanks.
David
Post Reply