CLOSED - RegEx EOF needed

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

CLOSED - RegEx EOF needed

Post by Bob Hansen » Thu Mar 19, 2009 3:44 am

I work with another product that uses a RegEx engine. It has the value of \z that represents EOF. I don't see an EOF pattern in Perl or EasyPatterns. Any chance of createing that capability for us?

Is very useful to add footers to files and to truncate files.
Last edited by Bob Hansen on Thu Mar 26, 2009 4:19 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Mar 26, 2009 9:09 am

\Z is standard Perl RegEx for "Assert position at very end of string". It therefore *IS* supported by Macro Scheduler's RegEx implementation.

The EasyPatterns keyword for \Z is [textEnd]. for \A it is [textStart]

Let>pattern=\A[a-z]+\Z
RegEx>pattern,joe,0,matches,num,0

See:
http://www.regular-expressions.info/anchors.html
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Mar 26, 2009 4:27 pm

Thanks for that Marcus. 8)

I was used to thinking of string management on a line by line basis. I had used \Z like $. It never occurred to me to try it on an entire file vs. individual lines.

I already have http://www.regular-expressions.info as one of my RegEx references, I have just missed that \Z for EOF for all these years.

I learn something new every day here. Luv it!
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts