PDA

View Full Version : [SOLVED:] Need some help with the Regular Expression



stranno
12-14-2020, 07:56 AM
Hi,

I need some help with the use of the Regular Expression. Please have a look at the attached file. I don't get why both examples gives different results.

What I want to achieve is a False result if the eighth position in de given string "N123A34X00" is not an "X". In Example1 it is going well, but not in Example2.
What is the difference between both examples?

Thanks in advance for taking a look at my question and best regards,

Strano

PS
I have posted this thread earlier today but it seems not to appear. So a try it again. Don't want to bother anyone...

p45cal
12-14-2020, 09:32 AM
In each Select Case, instead of:
strPatroon = "\D{1}\d{3}\D{1}\d{2}"
it should be:
.Pattern = "\D{1}\d{3}\D{1}\d{2}"

stranno
12-14-2020, 10:39 AM
#$%$#@, I totally overlooked that typo. Thanks for your help p45cal.