RegExp error - Unexpected quantifier

Results 1 to 2 of 2

Thread: RegExp error - Unexpected quantifier

  1. #1
    Stig Lytjohan Guest

    Default RegExp error - Unexpected quantifier

    I get the following error when I run my script:<BR><BR>Microsoft VBScript runtime error &#039 800a139a&#039 <BR><BR>Unexpected quantifier <BR><BR>/news/loetmp.asp, line 28 <BR><BR><BR>The code for this file is (I removed some of the code)<BR><BR>Set objTear = Server.CreateObject("SOFTWING.ASPtear")<BR>urlTest = objTear.Retrieve("", 2, "", "", "")<BR>Set rWorldPop = New regexp<BR>rWorldPop.Pattern = "&#060;a href=\""/nyheter/(.*?)""&#062;(.*?)&#060;/a&#062;"<BR>rWorldPop.Global = True<BR>rWorldPop.IgnoreCase = True<BR>Set objCols = rWorldPop.Execute( urlTest ) &#060;-- this line is where the error occures.<BR><BR>Have any of you seen this error before ? I tried the page, but didn&#039t find anything.<BR><BR>Thanks in advance.<BR><BR>Stig Lytjohan<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: RegExp error - Unexpected quantifier

    A &#039quantifier&#039 in RegExp parlance is something like &#039*&#039 (previous char 0 or more times), &#039?&#039 (previous char 0 or 1 times) or &#039+&#039 (previous char 1 or more times).<BR><BR>The reason your getting this error is because of the fragment (.*?) which would mean &#0390 or 1 occurences of 0 or more occurences of any character other than newline&#039, which doesn&#039t make much sense.<BR><BR>Basically, you can&#039t follow a quantifier with another quantifier.<BR><BR>HTH<BR><BR>Dunc

Posting Permissions

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