Replace Exact misparses $ in Replace with

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

DFH
Posts: 644
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Replace Exact misparses $ in Replace with

Postby DFH » Mon Feb 13, 2012 11:45 pm

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

DFH
Posts: 644
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Replace Exact misparses $ in Replace with

Postby DFH » Mon Feb 13, 2012 11:55 pm

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!

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace Exact misparses $ in Replace with

Postby DataMystic Support » Thu Feb 16, 2012 6:17 am

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.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

DFH
Posts: 644
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Replace Exact misparses $ in Replace with

Postby DFH » Mon Feb 20, 2012 3:57 am

Thanks.


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 2 guests