Text Pattern Matching

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

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

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

Text Pattern Matching

Post by adoucette » Wed Dec 31, 2014 2:18 pm

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: 4
Joined: Sat May 10, 2014 12:54 am

Re: Text Pattern Matching

Post by adoucette » Wed Dec 31, 2014 2:52 pm

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

Paul - Tracker Supp
Site Admin
Posts: 4865
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Text Pattern Matching

Post by Paul - Tracker Supp » Wed Dec 31, 2014 9:19 pm

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.
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

Puffolino
User
Posts: 133
Joined: Wed Feb 09, 2011 1:06 pm

Re: Text Pattern Matching

Post by Puffolino » Sat Sep 26, 2015 5:47 pm

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: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Text Pattern Matching

Post by Tracker Supp-Stefan » Mon Sep 28, 2015 11:00 am

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: 133
Joined: Wed Feb 09, 2011 1:06 pm

Re: Text Pattern Matching

Post by Puffolino » Sun Oct 04, 2015 11:19 am

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: 13296
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Text Pattern Matching

Post by Tracker Supp-Stefan » Mon Oct 05, 2015 9:22 am

:)

Post Reply