Regex Explanation

Can any one explain this regex ?
what does ?<= do ?
"(?<="Hello ")(.*?)(?="Bie “)”

1 Like

Hi @Krutika_Kotkar

Based on this regex it will ?<= is where we can check a particular string or number etc

It is used to get the value other than hello

Go to this site and learn new things

Ashwin S

Even ?=“Bie” does the same right ?
then instead of ?<=“Hello” in the above string can i use ?=“Hello”?



1 Like

@Krutika_Kotkar Assume you have a string ” Hello uipath forum Bie” here if you want extract only uipath forum than you can use the regex which you mentioned.

(?<=Hello) = Matches beginning of the string

(.*?) = Matches any character (from the string uipath forum)

(?=Bie) = Matches end of the string

When you want to extract data between the string than you can use this regex

what if i want to extract “hello uipath” from
“this is hello uipath forum bie”
i.e include the start word that is used for matching?

how will i manipulate (?<="Hello ") this for including hello also

1 Like

@Krutika_Kotkar To get hello uipath you needs to include (?<=this is)

Have a look here

But the thing is i don’t know what string is going to come before hello

1 Like

@Krutika_Kotkar Can you specify some example strings.

Yup it’s solved got it :slight_smile: thank you
“(?=” + strLabelBefore + “)(.*?)(?=” + strLabelAfter + “)”

this works

1 Like