I just really started learning how to use regex\'s and i am trying to create one to match urls. So far i have:
(http://|https://|www|\\w)+\\.[\\w]{2,4}[^\\s]+ >
Give this one a try: ^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$ Note that depending on how you are using it, you might want to remove the ^ and $ from the beginning and end.
^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$