Editing Selectors for click activity using Regular expression and substring

Dear All, @cornel

In my project, I have to match block name, flat name, floor name captured from a client’s application to fields in the drop down menu on different bank websites.

My main challenge is, how to write a code in the selectors of click or select item activity to make desired selection under following scenarios:

Scenario 1. Block Name (Extracted from client’s application system): “A”

When tried to match it on first bank’s website the item in the drop down menu appears in following formats:

a) “Block/ Tower A”
“Block/ Tower B”
“Block/ Tower C”
“Block/ Tower D”

b) “Block/ Tower 1”
“Block/ Tower 2”
“Block/ Tower 3”
“Block/ Tower 4”

c) “Block/ Tower A ESO Housing corporation FC”
“Block/ Tower B ESO Teller Corp”
“Block/ Tower C ESO 10 Manning”

(Notice in this above pattern we could still recognize block: “A” although it is present in the middle and the text following it (housing corporation) is irrelevant)

Scenario 2. Block Name (Extracted from client’s application system): “A”

When tried to match it against the relevant fields on the banks websites - Block number or name does not exist instead street name or road name appears in the drop down menu or it could be the same as building name

a) 91 95 welling street

b) 11 12 de vouex road

c) Queens Apartment 33 (Same item as appeared in the building name drop down menu)

How could I write a regex and substring in the above two scenarios to make the selection on the basis of particular keyword?

Please, can anybody demonstrate it to me in the above scenarios?

You may refer to following two websites for further analysis:

Please advise.

@ClaytonM, I know you have explained previously but I am unable to write a proper code in the above scenarios.

@ClaytonM @nadim.warsi @aksh1yadav @neonova @Manjuts90 @Divyashreem @indra @farhan94 @prassin6 @cornel


Strictly about the RegEx, Scenario 1, how about this?

Sample 2018.3.2 level workflow with the actual pattern and string test: DetectFirst.xaml (5.6 KB)
And the output that matches the 3 first lines but not the 4th (it shouldn’t):

For the Scenario 2, I do not exactly understand, but it sounds like you should extract addresses from somewhere and perform a full match.


Hi @cornel, In the second scenario, the entries for Block name/ number on HSBC and Hang Seng are replaced by the street names as mentioned above i.e. in the drop down menu for block field on HSBC and Hang Seng Websites for many buildings contain entries of street name or street number or even the building name instead of block name or block number.