Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    143
    Thanks
    14
    Thanked 1 Time in 1 Post

    regex quick help - im an idiot :P

    hi there

    regex help is required please!

    I need my regex to find chkEP[]= from an url string so i use :

    Code:
    function getValeurURL(nom)
    {
             //nom = chkEP[]=
    	 nom = nom.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    	  var regexS = "[\\?&]"+nom+"=([^&#]*)";
              //regexS = chkEP\[\]=
    	  var regex = new RegExp( regexS );
    	  var resultat = regex.exec( window.location.href );
              //window.location.href = http://blabla?chkEP[]=5
    	  if( resultat == null )
    		 return "";
    	  else
    		 return resultat;
    }
    this regex wont find my chkEP[]= at all :S


    edit : wow i'm tired. I have to use %5B%5D for URL brackets xD
    Last edited by Jahren; 06-18-2009 at 09:05 PM. Reason: im an idiot


 

Posting Permissions

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