Tricky Regular Expression with a Alphanumeric pattern in uppercase

497 views Asked by At

Okay this might not be tricky at all for some but at the moment really screwing up with my head.

First of all i don't know what engine i am dealing with, but it doesn't seem to identify uppercase.

I have a string for example

Circuit Ref

    Service Type

    A End Address

    Z End Address











52GD J32SD41 O2AE EVC001

    Evolve Internet

And I am only trying to extract the string "52GD J32SD41 O2AE EVC001". I have already tried quite a few combinations like

  1. [0-9A-Z]{4}\s[0-9A-Z]+\s[0-9A-Z]+\s[0-9A-Z]+
  2. [A-Z0-9]{4}\s\W+\s\W+\s\W+
  3. [A-Z0-9]{4}\s[A-Z0-9\s]*[A-Z0-9\s]*[A-Z0-9\s]*

Nothing seem to work...I want to keep the expression fairly flexible as the expression can change order of the letters and digits. but the pattern is mostly same. Any nudge in a right direction will be greatly appreciated.

Thanks

1

There are 1 answers

0
industryworker3595112 On

This is wild guess, but please try following things:




BTW. Regarding 2nd case that you tried: [A-Z0-9]{4}\s\W+\s\W+\s\W+.
Seem that you tried to use \W as "upper case word character", but it is not what it means.
\W means anything that is not \w. That is any non-word character.