Sample string:
dadasd_37=12abc_dadasd_asdasdasd_asdas_asd
My regex:
(?:_37=)([^_]+)
What i am trying to get:
12abc
(anything that starts with37=
and the word ends with_
).
However, the full match is still coming as _37=12abc
Sample string: dadasd_37=12abc_dadasd_asdasdasd_asdas_asd
My regex: (?:_37=)([^_]+)
What i am trying to get: 12abc
(anything that starts with 37=
and the word ends with _
).
However, the full match is still coming as _37=12abc
Capturing group matches are accessed via the SubMatches collection.
<%
Dim regex, matches, match, strSubject, strResult
strSubject = "dadasd_37=12abc_dadasd_asdasdasd_asdas_asd"
set regex = new RegExp
regex.IgnoreCase = True
regex.Pattern = "(?:_37=)([^_]+)"
set matches = regex.Execute(strSubject)
if matches.Count >= 1 then
set match = matches(0)
if match.SubMatches.Count >= 1 then
strResult = match.SubMatches(0)
else
strResult = ""
end If
else
strResult = ""
end if
response.write "strResult:" & strResult & ""
%>