Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pattern match question 1

Status
Not open for further replies.

marc7

Programmer
Oct 4, 2001
35
0
0
US
i am doing a pattern match and had a question. the following is not working properly and i cannot figure out what i am doing wrong:

Dim objRegExpr, s
Set objRegExpr = New regexp
objRegExpr.Pattern = id & ",(\w*)"
objRegExpr.Global = True
objRegExpr.IgnoreCase = True
s = $1

i want to be able to store and print out the (\w*) info later. is it possible to do that?
 
the variable id will need to be set as part of the pattern.
rate now it is outsie the patterns perameters.

you can get a idea of how to do that in this
thread in thread333-485850

here's a brief example also
I imagine you are trying to match something like numeric then alphanumeric as 23,a ?correct?

say id = 23
so to pass this value to the pattern which all patterns
need to be within ( ) so you need to output to the pattern
(23).
so
dim idPtn, ptrn
idPtn = "(" & id & ")"
ptrn = "(" & idPtn & "+,(\w*))"
' ouput = ((23)+,(\w*))
then execute
objRegExpr.Execute(str) _________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top