cancel
Showing results for 
Search instead for 
Did you mean: 
leehouren
Level 8

HDLP Regex " /b " Question

Hi Community,

Need help on the /b limitation

Suppose i have a regex for Passport Numbers

\b([A-Z]{1}[A-Z0-9]{1}[0-9]{7})\b

Matched

A12345678

A12345678 A12345678

Non-Matched

ABA12345678

A12345678A12345678

-----------------------------------------------------------------------------------------------------------------------------------

The issue im facing is with symbols and non words character, if included it will be considered as Matched. This has caused a lot of false positives,

For example,

.A12345678 = Matched

#A12345678@$ = Matched

%A12345678$ = Matched

how can i exlude the non-words character?

0 Kudos
1 Reply
bphang
Level 10

Re: HDLP Regex " /b " Question

Try with \s\b([A-Z]{1}[A-Z0-9]{1}[0-9]{7})\b\s

0 Kudos