Why does this not work

Results 1 to 3 of 3

Thread: Why does this not work

  1. #1
    Join Date
    Dec 1969

    Default Why does this not work

    Why does this not work<BR>regexp = "" + ("/" + Trim(deleteList[z]) + "/g");

  2. #2
    Join Date
    Dec 1969

    Default RE: Why does this not work

    because it&#039;s wrong.<BR><BR>If you are using vbscript, I will assume regexp has been declared as a regexp object<BR>set the pattern by regexp.pattern = "whatever"

  3. #3
    Join Date
    Dec 1969

    Default read the docs:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsobjregexpression.asp<BR><BR>You do *NOT* put in the / characters when you build a regular expression as a string. And the flags ("g", in your case) are a separate argument.<BR><BR>On top of that, you are using a function (Trim) that doesn&#039;t exist in JS. Where is that coming from?<BR><BR>var re = new RegExp( deleteList[z], "g" );<BR><BR>Don&#039;t make up your own syntax. Use what is allowed by the language.<BR><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