We help IT Professionals succeed at work.

'search expression is too complex' error when using wildcard search

Andreas Hermle
on
Dear Experts:

I was gonna search for numbers with the following make-up in the current document witht the following search expression ('use wildcards' is checked)

Numbers to be searched: 77-88-23-44, 99-22-34-11 etc.

Search expression: <[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9]>

I am greeted with the following prompt when running the search operation: 'The expression in the search field is too complex'

Any idea from the experts what is wrong with my expression.

Thank you very much in advance for your professional help.

Regards, Andreas
Comment
Watch Question

Top Expert 2014

Commented:
Can you use this non-wildcard search?
^#^#-^#^#-^#^#-^#^#

Open in new window

Top Expert 2014

Commented:
For some reason, the Word wildcard search would rather have you indicate the repeated digits than have you double the [0-9] pattern.
<[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}>

Open in new window

Andreas HermleTeam leader

Author

Commented:
Hi aikimark,

thank you very much for your swift and professional help. Ok, great, this works just fine.

So, searching with wildcard characters is not possible in the above case, do I get his right?

And another question: As a matter of fact, I need to add -09 at the end to all numbers found, i.e.

Before: 77-88-23-44   After: 77-88-23-44-09
Before: 99-22-34-11   After: 99-22-34-11-09
Before: 33-24-72-53   After: 33-24-72-53-09

Help is much appreciated. Thank you very much in  advance.

Regards, Andreas
Top Expert 2014
Commented:
Find:
<([0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2})>

Open in new window

Replace With:
\1-99

Open in new window

Andreas HermleTeam leader

Author

Commented:
Hi akimark,

oh, great job, works like a charm. Thank you very much for it.  I highly appreciate it.

One more thing which I would like to draw your attention to:
If I replace all the numbers as you suggest with your search and replace action once, everything works out fine.
If I inadvertently repeated it, it would add the -99 once again.

Can't I resrict the search operation to just numbers with the following make-up ##-##-##-## (54-33-22-11), i.e. max of 4 pairs of two-digit numbers.
The current search term would also find numbers such as 54-33-22-11-09

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Andreas HermleTeam leader

Author

Commented:
here the graphic that supports my questionrepeated search and replace operations
Top Expert 2014

Commented:
You might look for a "not hyphen" character instead of ">"
Andreas HermleTeam leader

Author

Commented:
Ah ok, great I got that, thank you very much for your great and professional help.
Andreas HermleTeam leader

Author

Commented:
Thank you very much for your valuable help. Regards, Andreas