need some help here...

FlyBoy

Well-known member
Joined
Sep 6, 2004
Messages
106
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).
 
use the "^" and "$" characters.

Code:
"^((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.
 
John_0025 said:
use the "^" and "$" characters.

Code:
"^((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:
 
Back
Top