Quoting a pattern

Results 1 to 2 of 2

Thread: Quoting a pattern

  1. #1
    Join Date
    Dec 1969

    Default Quoting a pattern

    &nbsp;<BR>In Perl you can do the following.. /Q$iE/<BR><BR>Which will quote what&#039;s in $i with the Q and E. Is there anything like that in VBScript? I have a table with patterns that I&#039;d like to match against and some may contain special characters. It&#039;s going to be counter productive to have to write something that goes through and finds each special character and escapes it out in order to match. <BR><BR>Any toughts would be appreciated. <BR><BR>Thanks,<BR>Rich

  2. #2
    SPG Guest

    Default A VBScript Pattern is just a string...

    ...and, coming from Perl, this annoyed the heck out of me until I realized what it was good for.<BR><BR>for i = 0 to ubound(strFindThis)<BR>objRE.pattern = "" & strFindThis(i) & ""<BR>response.write objRE.test(strUserInput)<BR>next<BR><BR>That the sort of insight you need? <BR><BR>(Note that I still have reservations about the model, given other implications of severing the pattern from the matching process -- especially the substitution -- but at least it&#039;s generally better than nothing...)<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts