Forum Discussion

ngocvo3103_1's avatar
ngocvo3103_1
Occasional Contributor
13 years ago

Regular Expression in FindChild/FindAllChildren methods

Hi all,



I'm facing a problem when using the FindChild/FindAllChildren methods.

I'm find the child using the following properties: ObjectType and innerText to find an email in Inbox of Yahoo mail. Using the Object Spy, I can see the value for ObjectType is Panel, and for the innerText is something like: from + subject + time (Ex: fromsubject3:53 PM). There is no problem with the ObjectType. for the innerText, I'm trying to use regular expression for this case (Ex: fromsubject\d+:\d+\s(AM|PM)), but it's not working. Using wildcard here can make FindChild work but it will match another object also. Is there any solution for this case?



Thank you for reading.


2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Regular expressions are not parsed within the context of the FindChild methods.  They use a string search in order to match the search parameter to the object parameter.  Your best bet is to use the wildcards to find the specific e-mails you're looking for.
  • tozogabee's avatar
    tozogabee
    New Contributor

    I wanted to use into the FindAllChildren the Side*R(\d+)-(\d+) to find the for example Side R03-01 contentText.

    But how can I do it?