Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regex works but how do i return the found string to a variable
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Ok I managed to get it to work using the following I found on the net:

Code:
Dim re, testresults, showresults

Set re = new regexp
re.Pattern = "([A-Z]{2})-([0-9]{3})-([A-Z]{1})-([0-9]{2})"
re.Global = true
re.IgnoreCase = true

set testresults = re.Execute(response)
For each match in testresults
    showresults = showresults + match.value
Next

msgbox showresults

Unfortunately I didn't realize in the string i was searching there are 28 separate matches for that search which are all valid but all different.

I just need the very last instance of the match for my purposes.

Does anyone know what the regex is for this?

I am a bit new to regex


Reply


Messages In This Thread
RE: regex works but how do i return the found string to a variable - by jove1776 - 08-24-2011, 05:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  WebElement not found in OR mv8167 6 6,035 03-27-2012, 09:10 PM
Last Post: mv8167
  ReGex not working for Java Items jimrazak 0 2,207 02-23-2012, 06:17 PM
Last Post: jimrazak
  Return the last number of “Test” mv8167 4 3,758 02-07-2012, 03:40 AM
Last Post: mv8167
  Turn Off RegEx mv8167 4 4,728 09-27-2011, 10:20 PM
Last Post: mv8167
  QTP 9.2 RegEx issue ashv 2 3,838 02-20-2011, 12:48 PM
Last Post: ashv

Forum Jump:


Users browsing this thread: 2 Guest(s)