Text Pattern Matching

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
adoucette
User
Posts: 8
Joined: Sat May 10, 2014 12:54 am

Text Pattern Matching

Post by adoucette »

Do you have instructions and/or examples for text pattern matching in bookmark generation?
If I use Menu --> Advanced --> Bookmarks --> Generate Bookmarks From Page Text, then in the "Add" "Bookmark Text Matching Options" dialog, there is the option for "Match Text Pattern".
See image here:
Image

What style of Regular Expression is used? What are the RegEx options allowed?
I ask because when I try to use it, I either get no matches or PDF-XChange Editor immediately crashes.
For example, the string "[0-9]{1,3}.+?" will cause it to crash, and "\d{1,3}.+" will get no matches.
"[0-9]{3}\..+" will match what I need but the entire line, and "[0-9]{3}\..+\p{P}+" should match what I need but causes a crash.
I'd rather not have to figure this out by trial and error.

Thank you,
Ari
adoucette
User
Posts: 8
Joined: Sat May 10, 2014 12:54 am

Re: Text Pattern Matching

Post by adoucette »

I see now that it is ECMA script, and can be referenced here: http://www.cplusplus.com/reference/regex/ECMAScript/
There's a nice free RegEx builder with an ECMA option (choose c++ as language in menu --> tools and tick ECMA checkbox in lower left of main window) here: http://www.ultrapico.com/Expresso.htm
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6897
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Text Pattern Matching

Post by Paul - Tracker Supp »

Hi Ari,

thanks for this. As you have noticed, this is very new and not documented yet. We do plan to be taking on the documentation in earnest when we return to the office in the new year so this should change quite soon.

I didn't realize that it was either of ECMA or RegEx. I do know that full RegEx support either means essentially reinventing the wheel (write our own support from the ground up) or include some third party libraries. I'm not sure at this point where we will go but seeing your post I am keen to find out from the development team exactly what was built into this "Bookmark Text Matching Options" and how to use it.

Hope to have more for you in a few days.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Puffolino
User
Posts: 321
Joined: Wed Feb 09, 2011 1:06 pm

Re: Text Pattern Matching

Post by Puffolino »

Tried out this nice feature today (did search it in the bookmark menu for a while) and found a small problem when combining multiple text lines to a single bookmark ("allow bookmarks on multiple text lines" or so):

A page conatining the following text...
___________

THIS IS A
HEADLINE

blah blah
___________

...creates a bookmark "THIS IS AHEADLINE", it would be fine to have an option to insert a space between the text lines (THIS IS A HEADLINE).
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Text Pattern Matching

Post by Tracker Supp-Stefan »

Hi Puffolino,

I've just created a feature request in our internal ticketing system for this:
#3246: FR: Add an option to add space when creating bookmarks from multiple lines.
So it will be looked at and implemented when time allows.

Regards,
Stefan
Puffolino
User
Posts: 321
Joined: Wed Feb 09, 2011 1:06 pm

Re: Text Pattern Matching

Post by Puffolino »

Tracker Supp-Stefan wrote:Hi Puffolino,

I've just created a feature request in our internal ticketing system for this:
#3246: FR: Add an option to add space when creating bookmarks from multiple lines.
So it will be looked at and implemented when time allows.

Regards,
Stefan
Thank you, tracker support is doing a create service!
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Text Pattern Matching

Post by Tracker Supp-Stefan »

:)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Text Pattern Matching

Post by Tracker Supp-Stefan »

Hello Puffolino,

Belated - but this ticket is now marked as resolved, so the fix will be available in the next build of our products!

Kind regards,
Stefan
Post Reply