Web Analytics Made Easy -
StatCounter unexpecte quantifier in IE..WH->i'm using regex's..is that it..HELP?? - CodingForum

Announcement

Collapse
No announcement yet.

unexpecte quantifier in IE..WH->i'm using regex's..is that it..HELP??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • unexpecte quantifier in IE..WH->i'm using regex's..is that it..HELP??

    Hey all,

    I have on a linux box and in Mozilla..my script is just fine..In IE..it bombs...I am gettting this error:

    unexpected quantifier
    Code=0

    Here is my regex's....

    var re = new RegExp ('_', 'gi');
    var emailcheck=/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/
    var verify=/^\d{10}/
    var verifybday=/^\d{2}\-\d{2}\-\d{4}+$/
    var verifyphones=/^\d{3}\-\d{3}\-\d{4}+$/

    and here is how I test against them...

    if((document.form.email)&&(!emailcheck.test(document.form.email.value))){
    msg+="Valid Email\n";
    Regpass=false;
    }



    there are a couple of IF statements..nothing complicated other than the regexs...but I am getting this error..anyone know why????

    please advise.......kinda urgent

  • #2
    Can you give the line number and the line(s) that the error is produced on?

    Offhand I don't see anything wrong but I don't see re being used anywhere, and to be honest I've never used that kind of syntax so I'm not sure about that one.

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

    Comment


    • #3
      hello,

      actually,,,the code is very long....that was just a slice of it....I don't actually use that first REGEX...I will take this out..

      var re = new RegExp ('_', 'gi');

      line: 166
      char: 37

      I suspect it is one of these lines...as I've used that email regex before without a hitch...

      var verifybday=/^\d{2}\-\d{2}\-\d{4}+$/
      var verifyphones=/^\d{3}\-\d{3}\-\d{4}+$/

      the "+" sign does seem off as I explicity say "4"...then i use the "+" sign...

      hmm, let me take that out....any other thoughts..thanks

      Comment


      • #4
        Dave is right...

        http://developer.netscape.com/docs/m...p.html#1010922

        Check that out, it's a great reference for regular expressions. Go there and you'll see why what he said makes perfect sense.

        +

        Matches the preceding character 1 or more times. Equivalent to {1,}.


        For example, /a+/ matches the 'a' in "candy" and all the a's in "caaaaaaandy".
        Former ASP Forum Moderator - I'm back!

        If you can teach yourself how to learn, you can learn anything. ;)

        Comment

        Working...
        X