Results 1 to 12 of 12

Thread: Regular expression

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Regular expression

    How to use the Regular expression? Please give an example. In which circumstances we can use it? Please help


  2. #2
    Contributing Member
    Join Date
    Feb 2008
    Answers
    36

    Re: Regular expression

    Hi There,

    Regular expressions are used when the values of the objects are varying(dynamic data).

    For example when you login to yahoo mail with user name "XYZ", on the top you see "Welcome XYZ" if you login as "ABC" the screen display "Welcome ABC"

    You can define a regular expression as:

    Dim regEx, Match, Matches ' declare variable
    RegExpTest = "" ' initial the result variable
    Set regEx = New RegExp ' create a regular expression object
    regEx.Pattern = "[a-zA-Z0-9 ]" ' set its pattern
    regEx.IgnoreCase = True ' set case insensitivity

    Here "Pattern" will be your regular expression and you can use it wherever the data is dynamic.

    I hope it's clear, do get back incase you still have doubts.

    Regards,
    Tina Mahajan.


  3. #3
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Red face Re: Regular expression

    Hi Tina,

    U so lovely ! Thank you soo much for ur reply.

    THis is clear with me. I have one more doubt - When we are going to parameterize we wil get a screen with a checkbox for Regular expression. My doubt is how to use and when to use that regular expression check box. You have given the coding. My doubt is here..

    Please gimme the answer for this also


  4. #4
    Contributing Member
    Join Date
    Feb 2008
    Answers
    36

    Re: Regular expression

    Hi there,

    I didnt get your question.

    When you parameterize, u get a "Value Configuration Options" screen. There is no checkbox here. There are RadioGroups.

    Using parameteriztion you are providing different values that are to be entered in the form of data table. You dont have to use regular expressions here.


    Regards,
    Tina Mahajan

    Last edited by Tina Mahajan; 06-05-2008 at 12:48 AM.

  5. #5
    Junior Member
    Join Date
    Jun 2008
    Answers
    6

    Smile Re: Regular expression

    Hi Tina,

    I will clear my question with an example.

    Record any link. Goto Object Repository->Click on the specified link ->On the right side of the repository u can see the 'Test Object Details' - below that 'name' and 'value'. Click on the text(for example)-In the value column you can see the text of the link and the right side <#> . Click on that - you will be in "Value Configurations Options" box. There u can see the check box "Regular expression". ( )

    My question is how it will be useful in that condition?

    Love

    Euro


  6. #6
    Contributing Member
    Join Date
    Feb 2008
    Answers
    36

    Re: Regular expression

    Ok got it now!

    When you select constant and check on the regular expression,

    You can simply substitute a value with regular expression like [a-z][A-Z][0-9]
    in the textbox infront of constant radiobutton.
    So this will refer to any link having alphanumeric value for name property.

    But when you are parameterizing, I dont think you need regular expression sice you can provide all the desired values in the data table.

    Regards,
    Tina Mahajan.


  7. #7
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: Regular expression

    hi tina
    i am nean u w in qtp. can u lemme know how to capture movie clip of result. in qtp 9.2.

    thanks in advns


  8. #8
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: Regular expression

    thanks for answers


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact