Need help to extract the value All from the paragraph

Hi Everyone,
Could anyone suggest me how to extract All keyword present after placeholder?

“<input autocapitalize=“off” autocomplete=“off” aria-autocomplete=“both” data-ktp-execute-target=“true” data-is-interactable=“true” id=“ComboBox105-input” class=“ms-ComboBox-Input css-141” type=“text” aria-expanded=“false” role=“combobox” spellcheck=“false” placeholder=“All, SR&ED, Tax Provision” data-lpignore=“true” value=”" style=“font-family: inherit;” uipath_custom_id=“104”><button type=“button” class=“ms-Button ms-Button–icon ms-ComboBox-CaretDown-button root-148” role=“presentation” aria-hidden=“true” data-is-focusable=“false” tabindex="-1" uipath_custom_id=“184”><span class=“ms-Button-flexContainer flexContainer-149” data-automationid=“splitbuttonprimary” uipath_custom_id=“70”><i data-icon-name=“ChevronDown” aria-hidden=“true” class=“ms-Icon root-33 css-118 ms-Button-icon icon-151” style=“font-family: FabricMDL2Icons;” uipath_custom_id=“226”>"

Hi @debosree,

When you ask a question it is always good you specify what your required output is. Do you mean you want to extract "All, SR&ED, Tax Provision" ?
“All, SR&ED, Tax Provision “true” "style=“font-family: inherit" until the end of the string?

If you are looking for the first ("All, SR&ED, Tax Provision") : Approach using regex + split method. This method is independent of the number of placeholders so it will work for lesser than 3 and more than 3 placeholder values.

  1. You can use a regex expression which first extracts the placeholder values (Use the Matches activity in studio and provide this expression)
    placeholder=“(?P<placeholder>.*?)” . If it fails check the double quotes, I use the double quotes you pasted in your question as the string. Your original string pattern may be either " or “. Edit the expression as required.

  2. The Matches activity will then return a variable (which you can define yourself in studio) here I call it yourmatchesvariable. In this case, the value returned will be All, SR&ED, Tax Provision

  3. Later within UiPath you can use an assign activity
    Placholders (variable is string[] array type) = yourmatchesvariable.split(,c)
    This splits All, SR&ED, Tax Provision on a comma character and populates the Placeholders array resulting in Placeholders = {"All", "SR&ED", "Tax Provision"}

  4. Then you can poll the array to get your values.
    Placholders(0) resulting in All
    Placholders(1) resulting in SR&ED
    Placholders(2) resulting in Tax Provision

Is there a better way?
Probably, yes. An approach which only uses regex, but other forum members can help you with that. The approach would be to use a Named Group with a quantifier in the expression and return multiple groups for each value of the placeholder.

Hope the explanation helps you.

Hi @debosree

You can make use of pattern based search through RegEx.

Please refer the below CheatSheet for Regular Expression.

Thanks to @ppr for this.

Hope this will be helpful. Thank you.

Hi Jobin,
I was able to extract the ‘All’ value using match and then compare value to get the match found.
But, sometimes I observed that the value of GetAttribute is returning “Select Workflow Template” for innerhtml placeholder instead of ‘All’ for the dropdown.Hence, the logic is getting disturbed and not able to validate ‘All’ value.

Could you pls suggest what should I do in that case?Any idea why placeholder value is getting changed?

Thanks …My innerhtml returned:-

I have used regex :(?<= placeholder=).*(?= data-lpignore)
I want to get output as All but sometimes I’m observing my innerhtml is returning “Select Workflow Template” instead of All in placeholder.Pls let me know if you know why it behaves that way?