Perl syntax blindness

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

dgcuff
Posts: 4
Joined: Fri Mar 20, 2009 1:43 am

Perl syntax blindness

Postby dgcuff » Thu Apr 16, 2009 11:17 pm

I can't see what I'm doing wrong, and need a second pair of eyes to check me.

My find pattern (type perl) is "on page \d{1,3}". My replacement is "on page <pagenum>".

When the text is "on page 333", the result is "on page <pagenum>33".

I would have thought that the find pattern would deal with all cases of "on page 333", "on page 22", and "on page 1", but that's not what happening, and I can't seem to shake my brain out of its preconceptions.

Where amI going wrong?

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

Re: Perl syntax blindness

Postby DataMystic Support » Sat Apr 18, 2009 7:54 pm

You need to force the perl pattern to grab all numerics - not just the first like this:
\d{1,3}?

Alternatively you can set the greediness option under the [...] button next to the search type drop-down
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


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

Who is online

Users browsing this forum: No registered users and 9 guests