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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greedy quantifiers with vbs regular expressions

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having trouble with greedy quantifiers using vbs regex. This works with Perl:<br>&nbsp;&nbsp;&nbsp;&lt;IMG.*?&gt; if I am looking for html image tags in a html doc<br><br>It doesn't work with vbscript. (Error: unexpected quantifier). Other regex that I have tried work fine.<br><br>Thank you in advance for considering this.<br>
 
I'm not positive, but I'm pretty sure that VBScript simply doesn't support non-greedy quantifiers. You'll probably be better off using something like &quot;<IMG[^>]*>&quot; to search for html image tags. If you've used Perl regular expressions very much, I think you'll find there's a lot you can't do with them in VBScript simply because of a lack of support.

The MS Developers Network has a so-so overview of their regular expression support at: Click on VBScript and then Regular Expressions Guide. It doesn't have a whole lot of examples, but it is a good reference.

MM
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top