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

Thanks
Ashwin S

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

Yes

Thanks
AshwinS

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

thanks
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