SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Jul 2008
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    What does this regular expression mean?

    "^" & variable & " ?=\s*(.*?)\s*$"

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    Actually, I do not understand what "(.*?)" mean here.

    [ QUOTE ]
    "^" & variable & " ?=\s*(.*?)\s*$"

    [/ QUOTE ]

  3. #3
    Senior Member
    Join Date
    Mar 2010
    Location
    12.985475,80.229696
    Posts
    168
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    From QTP Help
    .* = characters to find zero or more occurrences of any character (except \n)
    ? = match zero or one occurrences of the preceding character

    that mean ur "variable" can have "any characters" or it can be "null" as well

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    Thanks. I did some research and got to know why they put parentheses here. This is from QTP help:

    "When a regular expression is executed, zero or more submatches can result when subexpressions are enclosed in capturing parentheses. Each item in the SubMatches collection is the string found and captured by the regular expression."

    [ QUOTE ]
    From QTP Help
    .* = characters to find zero or more occurrences of any character (except \n)
    ? = match zero or one occurrences of the preceding character

    that mean ur "variable" can have "any characters" or it can be "null" as well

    [/ QUOTE ]

  5. #5
    Junior Member
    Join Date
    Jun 2010
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    This is the expression i get in dialog box:
    Application No:1318160001411 Batch No:666201018109 Shift No:

    I tried to use regular expression but to no avail. This is what i tried.

    VbWindow("mainmdi").Dialog("text:=Application No[0-9]{13}) Batch No[0-9]{12}) Shift No:") but for some reason its failing.

    Any tips on how to make it work?

  6. #6
    Advanced Member venu.adhikesevan's Avatar
    Join Date
    Jun 2010
    Posts
    517
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    VbWindow("mainmdi").Dialog("text:=Application No[0-9]{0,13}) Batch No[0-9]{0,12}) Shift No:")
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

  7. #7
    Member
    Join Date
    Oct 2007
    Location
    shanghai, china
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    i think this means the non-greedy matching, it means it will match the shortest pattern of the regular expression, also store this value, in JS we can use \1 \2 to retrieve it, in QTP we will use $1 $2 to fetch it.

  8. #8
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: What does this regular expression mean?

    [ QUOTE ]
    i think this means the non-greedy matching, it means it will match the shortest pattern of the regular expression, also store this value, in JS we can use \1 \2 to retrieve it, in QTP we will use $1 $2 to fetch it.

    [/ QUOTE ]

    That is right. Also manbeing no point in posting in your r.e. without posting the text it is being used for. It is difficult reverse engineer a pattern and tell what kind of pattern it would actually match

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.38%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:25 AM.

Copyright BetaSoft Inc.