Jump to content

help with regular expression please


n8w

Recommended Posts

I have a portal where people submit links .. but I want to make sure none of the links end in "/"

for exampel .. I want the links submitted to be like
http://www.phpfreaks.com
not
http://www.phpfreaks.com/

I am trying to check this with javascript .. but can't get it to work

[code]
var the_headline_link=/$(\/)/
if (document.submitlinks.link_url.value.search(the_headline_link) == -1 ){
message+='Link can not end with / \n';
problem='yes';
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/34133-help-with-regular-expression-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.