Extract digits from string

Hi all,

short question: i want to have all numbers (only the first 4 digit number) from a list which start with “01”:

0127,Central WM
0128,Central WM
0129,Central WM
0130,Central WM
089I,Inbound EWM
089O,Outbound EWM
089P,PSA in EWM
9988,Packstücke WM
CM01,CM01 in 1000
CM02,CM02 in 1000

e.g. “0129”

I created a RegEx expression: \b(01)…
The goal is to have only 4 digit numbers, but the result also displays also numbers with 3 digits. What is the correct expression?

Thanks
Ottmar

Hi @Ottmar_Jobs

Within If Condition you will check as shown below :-

strVar.ToString.StartsWith(“01”)

Below is the regex for the same :-

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hi Er Pratik,

thanks for your quick reply!

I updated my regex, but it marks only the first entry:

Is there a way to extend the regex that only numbers starting with 01 are extracted?

Thanks
Ottmar

Hi @Ottmar_Jobs

Actually it wont matter.

For the reference I have attached one thread which have the same question that u have asked now :-

You will get your answer from the above thread.

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: