FlyBoy Posted September 9, 2004 Posted September 9, 2004 i have the following pattern (part of a pattern which validates urls..) i know its still not perfect but i have a question about it... this is the pattern : ("((http)|(https))://(w{3}\.)(\w)") it valids this : http://www.w should be ok. but when i enter this: http://www.ww.... it also ok....hmm...how to fix this that it would be accept the dots..?? its problem in here (\w). Quote
John_0025 Posted September 9, 2004 Posted September 9, 2004 use the "^" and "$" characters. "^((http)|(https)):\/\/(w{3}\.)(\w)$" This will match: "http://www.w" but not "http://www.w..." or ".....http://www.w" etc. Good luck with learning regular expressions. Quote
FlyBoy Posted September 9, 2004 Author Posted September 9, 2004 use the "^" and "$" characters. "^((http)|(https)):\/\/(w{3}\.)(\w)$" This will match: "http://www.w" but not "http://www.w..." or ".....http://www.w" etc. Good luck with learning regular expressions. 10x!! again.... ;) im progressing with regex... :cool: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.