<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Using Regex in the attribute of an element in Application Modeller in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75734#M28339</link>
    <description>Thnaks Ivan for your response. I will try and let you know if any further issue.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Amlan Sahoo&lt;BR /&gt;RPA Consultant&lt;BR /&gt;Equinix&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Wed, 17 Jun 2020 06:19:00 GMT</pubDate>
    <dc:creator>_Amlansahoo</dc:creator>
    <dc:date>2020-06-17T06:19:00Z</dc:date>
    <item>
      <title>Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75728#M28333</link>
      <description>Hi there,&lt;BR /&gt;&lt;BR /&gt;I am trying to make an action which should check if a specific label in a list of lables on a webpage exists, through its &lt;EM&gt;&lt;STRONG&gt;V&lt;/STRONG&gt;&lt;STRONG&gt;alue&lt;/STRONG&gt; &lt;/EM&gt;and &lt;STRONG&gt;&lt;EM&gt;HTML Path.&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;BR /&gt;&lt;/EM&gt;The &lt;EM&gt;&lt;STRONG&gt;V&lt;/STRONG&gt;&lt;STRONG&gt;alue&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;has&amp;nbsp;&lt;EM&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;/SPAN&gt;&lt;/EM&gt;match type&lt;EM&gt;&lt;/EM&gt;&amp;nbsp;&lt;STRONG&gt;dynamic,&lt;/STRONG&gt; i.e. it is an input to the action and the &lt;EM&gt;&lt;STRONG&gt;HTML Path&lt;/STRONG&gt;&lt;/EM&gt; changes depending on the labels position in the list and whether or not the label is clickable.&lt;BR /&gt;&lt;BR /&gt;Instead of having an element for each label in the list, I want to make the&amp;nbsp;attribute &lt;EM&gt;&lt;STRONG&gt;HTML Path&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;have the match type &lt;STRONG&gt;Regex&lt;/STRONG&gt; with the regex &lt;STRONG&gt;\d{1,2}. &lt;/STRONG&gt;As an&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;example: &lt;STRONG&gt;/HTML/BODY(1)/&lt;/STRONG&gt;&amp;nbsp;should be&amp;nbsp;&lt;STRONG&gt;/HTML/BODY(&lt;SPAN style="text-decoration: underline;"&gt;\d{1,2}&lt;/SPAN&gt;)/&amp;nbsp;&lt;/STRONG&gt;in &lt;STRONG&gt;Application Modeller&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;This way I will be able to find a specific lable through its&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;V&lt;/STRONG&gt;&lt;STRONG&gt;alue&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;using only 1 element in Application Modeller instead of&amp;nbsp; &amp;gt;20 unique elements&lt;BR /&gt;&lt;BR /&gt;However, this does not work. I have tried making&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;HTML Path&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;Dynamic, and in my Wait Stage made the &lt;EM&gt;&lt;STRONG&gt;HTML Path&lt;/STRONG&gt; params &lt;/EM&gt;be equal to &lt;STRONG&gt;regex&lt;/STRONG&gt;, but I get an error message there as well.&lt;BR /&gt;&lt;BR /&gt;My question is: How do you use the &lt;STRONG&gt;Regex&lt;/STRONG&gt; match type inside of Application Modeller?&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivan Khudur&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Apr 2020 12:41:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75728#M28333</guid>
      <dc:creator>IvanKhudur</dc:creator>
      <dc:date>2020-04-15T12:41:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75729#M28334</link>
      <description>In case someone comes across this and wonders how to solve it:&lt;BR /&gt;&lt;BR /&gt;An escape character (i.e. "\") is needed before each special character:&lt;BR /&gt;&lt;BR /&gt;The string I wrote in my first post &lt;STRONG&gt;/HTML/BODY(\d{1,2})/&lt;/STRONG&gt; should instead be written as &lt;STRONG&gt;\/HTML\/BODY\(\d{1,2}\)\/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;//Ivan&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivan Khudur&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Apr 2020 12:54:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75729#M28334</guid>
      <dc:creator>IvanKhudur</dc:creator>
      <dc:date>2020-04-22T12:54:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75730#M28335</link>
      <description>HI Ivan,&lt;BR /&gt;I tried the same but its's throwing expression for me. I set properly asa Dynamic and while passing I passed value as Regx as you mentioned but it did not work.&lt;BR /&gt;&lt;BR /&gt;Could you please help me with that.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Amlan Sahoo&lt;BR /&gt;RPA Consultant&lt;BR /&gt;Equinix&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 13 May 2020 11:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75730#M28335</guid>
      <dc:creator>_Amlansahoo</dc:creator>
      <dc:date>2020-05-13T11:15:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75731#M28336</link>
      <description>Hi Amlan,&lt;BR /&gt;&lt;BR /&gt;Could you please show how your regex looks like, as well as the exception?&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivan Khudur&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 15 May 2020 07:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75731#M28336</guid>
      <dc:creator>IvanKhudur</dc:creator>
      <dc:date>2020-05-15T07:12:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75732#M28337</link>
      <description>Hi Ivan,&lt;BR /&gt;&lt;BR /&gt;I just copied the same path you have provided above and tried to highlight.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Amlan Sahoo&lt;BR /&gt;RPA Consultant&lt;BR /&gt;Equinix&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 20 May 2020 09:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75732#M28337</guid>
      <dc:creator>_Amlansahoo</dc:creator>
      <dc:date>2020-05-20T09:28:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75733#M28338</link>
      <description>Hello again,&lt;BR /&gt;&lt;BR /&gt;The path I used was just an example. To clarify, let's say we have the HTML Path&amp;nbsp;&lt;STRONG&gt;/HTML/Table(1)/BODY(4)&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;We know that the number following&amp;nbsp;&lt;STRONG&gt;Table&lt;/STRONG&gt; changes value (i.e. it could be 1,2,3,4... etc) for different elements in the page. However, we are not sure what number the element we search for will have, that is it could be:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;/HTML/Table(1)/BODY(4)&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;or&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;/HTML/Table(2)/BODY(4)&lt;BR /&gt;&lt;/STRONG&gt;or&lt;BR /&gt;&lt;STRONG&gt;/HTML/Table(3)/BODY(4)&lt;BR /&gt;&lt;/STRONG&gt;etc.&lt;BR /&gt;&lt;BR /&gt;We want to use regex to match an element that has this HTML Path structure (&lt;STRONG&gt;&lt;EM&gt;Note&lt;/EM&gt;&lt;/STRONG&gt;: another unique attribute should be specified, otherwise Blue Prism would match several elements)&lt;BR /&gt;&lt;BR /&gt;To use the regex option on the Path-attribute of the spied element, you will have to write the HTML Path attribute in Application modeller as:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;\/HTML\/Table\(\d{1,}\)\/BODY\(4\)&lt;BR /&gt;&lt;/STRONG&gt;or&lt;BR /&gt;&lt;STRONG&gt;\/HTML\/Table\([0-9]+\)\/BODY\(4\)&lt;BR /&gt;&lt;BR /&gt;\d{1,} &lt;/STRONG&gt;and&lt;STRONG&gt; [0-9]+ &lt;/STRONG&gt;matches against 1 or more numbers (in a row) between 0 and 9&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;You have to use \ before "&lt;SPAN&gt;&lt;EM&gt;A character that otherwise would be interpreted as an unescaped language construct should be interpreted literally&lt;/EM&gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Here is the link to .NET documentation regarding regex&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/dotnet/standard/base-types/character-escapes-in-regular-expressions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivan Khudur&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:26:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75733#M28338</guid>
      <dc:creator>IvanKhudur</dc:creator>
      <dc:date>2020-06-03T09:26:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75734#M28339</link>
      <description>Thnaks Ivan for your response. I will try and let you know if any further issue.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Amlan Sahoo&lt;BR /&gt;RPA Consultant&lt;BR /&gt;Equinix&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jun 2020 06:19:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75734#M28339</guid>
      <dc:creator>_Amlansahoo</dc:creator>
      <dc:date>2020-06-17T06:19:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75735#M28340</link>
      <description>Hi Ivan,&lt;BR /&gt;&lt;BR /&gt;I've trying to add the Regex expression to my attribute as follow&lt;BR /&gt;&lt;BR /&gt;/HTML[1]/BODY[1]/DIV[&lt;STRONG&gt;\[0-9]+\&lt;/STRONG&gt;]/DIV[5] however Blue Prism is prompting the error "Error - Highlighting results - Exception has been thrown by the target of an invocation."&lt;BR /&gt;&lt;BR /&gt;I think that it's related to the character "&lt;SPAN&gt;&amp;nbsp;\". Could you please provide some input regarding this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Jose Bertozzi&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2021 15:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75735#M28340</guid>
      <dc:creator>JoseBertozzi</dc:creator>
      <dc:date>2021-07-05T15:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using Regex in the attribute of an element in Application Modeller</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75736#M28341</link>
      <description>Hello Jose,&lt;BR /&gt;&lt;BR /&gt;You need to add a backslash before all escape characters that are not an regex pattern as well as slashes.&lt;BR /&gt;&lt;BR /&gt;In your case I assume the "default" HTML attribute path looks something like this &lt;STRONG&gt;/HTML[1]/BODY[1]/DIV[1&lt;/STRONG&gt;&lt;STRONG&gt;]/DIV[5]&lt;/STRONG&gt;.&lt;BR /&gt;To match exactly this HTML attribute path you need to but a backslash infront of the characters /[] :&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;HTML&lt;STRONG&gt;[&lt;/STRONG&gt;1&lt;STRONG&gt;]/&lt;/STRONG&gt;BODY&lt;STRONG&gt;[&lt;/STRONG&gt;1&lt;STRONG&gt;]/&lt;/STRONG&gt;DIV&lt;STRONG&gt;[&lt;/STRONG&gt;1&lt;STRONG&gt;]/&lt;/STRONG&gt;DIV&lt;STRONG&gt;[&lt;/STRONG&gt;5&lt;STRONG&gt;]&amp;nbsp; &amp;nbsp; →&amp;nbsp; &amp;nbsp; \/&lt;/STRONG&gt;HTML&lt;STRONG&gt;\[&lt;/STRONG&gt;1&lt;STRONG&gt;\]\/&lt;/STRONG&gt;BODY&lt;STRONG&gt;\[&lt;/STRONG&gt;1&lt;STRONG&gt;\]\/&lt;/STRONG&gt;DIV&lt;STRONG&gt;\[&lt;/STRONG&gt;1&lt;STRONG&gt;\]\/&lt;/STRONG&gt;DIV&lt;STRONG&gt;\[&lt;/STRONG&gt;5&lt;STRONG&gt;\]&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;From here you can replace the value of the first DIV element with your character class and its quantifier &lt;STRONG&gt;[0-9]+&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;\/HTML\[1\]\/BODY\[1\]\/DIV\[&lt;STRONG&gt;[0-9]+&lt;/STRONG&gt;\]\/DIV\[5\]&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Note that you should not use backslashes for the character class's brackets or the quantifier.&lt;BR /&gt;&lt;BR /&gt;I would suggest to narrow down the possible matches as much as possible, as the regex pattern &lt;STRONG&gt;[0-9]+&lt;/STRONG&gt;, will match a number 1 or more times. This means it could match e.g. &lt;STRONG&gt;/HTML[1]/BODY[1]/DIV[100000&lt;/STRONG&gt;&lt;STRONG&gt;]/DIV[5]&lt;/STRONG&gt;.&lt;BR /&gt;If you know that the value of the DIV element ranges between 0 and 99, you could replace &lt;STRONG&gt;[0-9]+ &lt;/STRONG&gt;with &lt;STRONG&gt;[0-9]{1,2}.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Another thing you could try to narrow down the matches is to add anchors at the beginning and the end of your HTML Path like this:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;^&lt;/STRONG&gt;\/HTML\[1\]\/BODY\[1\]\/DIV\[[0-9]{1,2}\]\/DIV\[5\]&lt;STRONG&gt;$&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;This way you should avoid matching your HTML path in another HTML path, that has your HTML path as a substring.&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Here are links to the .NET documentation regarding regex quantifiers and anchors:&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/quantifiers-in-regular-expressions" target="test_blank"&gt;https://docs.microsoft.com/en-us/dotnet/standard/base-types/quantifiers-in-regular-expressions&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/anchors-in-regular-expressions" target="test_blank"&gt;https://docs.microsoft.com/en-us/dotnet/standard/base-types/anchors-in-regular-expressions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Ivan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivan Khudur&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Jul 2021 09:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Using-Regex-in-the-attribute-of-an-element-in-Application/m-p/75736#M28341</guid>
      <dc:creator>IvanKhudur</dc:creator>
      <dc:date>2021-07-06T09:01:00Z</dc:date>
    </item>
  </channel>
</rss>

