You are viewing limited content. For full access, please sign in.

Question

Question

Pattern Matching Options in Quick Fields

asked on September 30, 2015

Hi there,

We've just been working on some pattern matching where we're trying to get a string of letters and numbers. Because of the spacing between the characters the OCR sometimes adds excess whitespace and we found in the pattern matching dialogue an option to "Enable ignore whitespace" as shown in the screenshot below:

However this doesn't seem to work for us, is this how it's supposed to be used?

We have found a way around this but just for future reference really, any advise would be appreciated!

Cheers, Dan.

0 0

Answer

SELECTED ANSWER
replied on September 30, 2015

No, that construct indicates that spaces in the pattern should be ignored, not in the input. For ex, with your input "\w\w \b\b" matches "AB 12" ("2 characters, space, 2 digits"), but "(?x)\w\w \d\d" matches 1234 because it ignores the space in the middle and matches the first set of 4 characters. Given an input of "AB123456789GB", the first pattern would match nothing, while the second one would return "AB12".

0 0

Replies

replied on September 30, 2015

Why not just use \w+ set to All Matches (combined with no spaces)?

1 0
replied on October 1, 2015 Show version history

...Just tried Jim's suggestion, it was better mine so removed it...

0 0
replied on October 1, 2015

Ahh I see, thanks for the info! And thanks for the suggestions too. We went with something similar to what you suggested in the end Jim, was just curious as to what the option did.

Thanks again. Dan

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.