Regex for the particular word

Hi all I have a string like this:
Status:
Active

Status_code:
XYZ

Here I want to extract “Active” which is after status and next line.

When iam Triying to one regex it’s matching in regex101 but Iam using in UiPath it’s showing null.

Help me in this !!!

Thanks,
Srikanth.

@Srikanth_prem

Could you please show me screenshot of that expression how you are doing it in Uipath studio. So that we can check and help you where it went wrong.

@Srikanth_prem

Else you can try below expression.

             requiredStr = inputStr.Split(Environment.NewLine.ToCharArray)(1).Trim

Where as inputStr is your input string.

Hello @Srikanth_prem

You can use the above solution suggested by @lakshman it’ll split the value and give you your desired output .

Can you tell me what regex Pattern did you use ??

Try this pattern once to get the desired output

System.Text.RegularExpressions.Regex.Match(stringvariable,"(<=Status:\n)\w+").ToString

2 Likes

Try this
(?<=Status:\n)\w*

@Srikanth_prem