I am using VBscript in QTP and I am a bit confused:
Browser("name:=.*") //works
Why Browser("name:=*") does not work? Why is there a . character?
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While normal wildcards (such as those used in shells for specifying many files at once—e. g.
*.txt) use only the askterisk (*) as a sign for at zero or more arbitrary characters, in regular expressions it is a quantifier. It tells the regex engine something about the preceding token. A dot (.) matches a single arbitrary character, a dot followed by an asterisk thereby matches zero or more arbitrary characters.However, a
=followed by a*will match 0 or more equals signs (=)—since the asterisk always works on the preceding token, which is just the equals sign here.Note: A token can be many things, a single character like the
=, a character class, such as.,\wor[a-z], a group such as(abc)which would then match any string likeabcabcabc, &c. This allows for much richer types of expressions you can define than just the plain old wildcards.Generally the following equivalences between wildcards and regular expressions hold—approximately; there are some details which may not immediately be obvious: