We help IT Professionals succeed at work.

extract two character acronyms along with accompanying term, such as 3D-printing or 4k applications

Andreas Hermle
Andreas Hermle used Ask the Experts™
on
Dear Experts:

I managed to extract 2-character acronyms (number + letter), such as 3D, 4D, 4K etc. with the following search expression (wildcards checked)

<[0-9]{1}[A-Z]{1}

The search works just fine for the above expressions.


I also would like to be able to extract these kinds of acronyms along with accompanying terms (with or without hyphen) such as ...

3D animations
4D-printing
4K applications
4K-applications

How is the above search term to be extended to accomodate my requirements.

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

Regards, Andreas
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
GrahamSkanRetired
Top Expert 2012

Commented:
Hi Andreas,This works with your examples, but you might have some more difficult cases in mind.

<[0-9]{1}[A-Z]{1}>[ -]{1}<[a-z]{1,}>
Andreas HermleTeam leader

Author

Commented:
Hi Graham,

thank you very much for your quick help. Strangely enough your expression does not work on my side.

I guess I came up with my own solution

<[0-9]{1}[A-Z]{1}-[A-Z][a-z]{1;} or <[0-9]{1}[A-Z]{1} [A-Z][a-z]{1;}
Team leader
Commented:
<[0-9]{1}[A-Z]{1}-[A-Z][a-z]{1;} or <[0-9]{1}[A-Z]{1} [A-Z][a-z]{1;}