Regex the Extraction of checkbox enabled information

Hi Automation guys,
I want to get the information only on the checkbox-checked values from the list. Could you please share the regex expressions to resolve the task?
☐ 134091 ☒ 134092 ☐ 134093 ☒OK ☒ OK

Expected result: 134092 OK OK

Thanks!
Happy Automation

Hi @Iswarya_P1

Use the below regular expression,

- Assign -> Input = "☐ 134091 ☒ 134092 ☐ 134093 ☒OK ☒ OK"
- Assign -> Output = String.Join(" ",System.Text.RegularExpressions.Regex.Matches(Input,"(?<=☒\s?)(\d+|\w+)"))

image

Check the below workflow for better understanding,

Hope it helps!!

@Iswarya_P1

image

Use Find Matching Pattern Activity

For Each loop

OutputResult=String.Join(“,”, outputString, item.ToString())

Hope it helps

Hi @Iswarya_P1

Can you try the below

(?<=☒).*(?=☐)|(?<=☒).*(?= ☒)|(?<=☒ ).*(?=)

String.Join(" ", System.Text.RegularExpressions.Regex.Matches(Input,"(?<=☒).*(?=☐)|(?<=☒).*(?= ☒)|(?<=☒ ).*(?=)"))

Cheers!!

when we can rely on the textual presence of: ☐ ☒

A regex could look like this
grafik

we would trim the value

@Iswarya_P1 just curious to know wheather this text ☐ 134091 ☒ 134092 ☐ 134093 ☒OK ☒ OK Looks like this itself or the check and uncheck is image based selection