Alter regex to allow a url to span multiple lines.

  • Thread starter Thread starter recoil
  • Start date Start date
R

recoil

(http|ftp|https):\/\/[\w-_]+(\.[\w-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

I have the following RegEx which extracts URL's from texts. It does a
very good job however i need it to be able to match something like

http://www.bleah.com/pet
r.asp?bleah


I am at a loss on how to get it to continue searching if it spans a
single line. An example of a non-match however would be
http://www.bleah.com/pet

Peter tried publishing
 
what about space in the (\s I believe) in some places?
like
(http|ftp|https):\/\/[\w-_]+(\.[\s\w-_]+)+([\s\w\-\.,@?^=%&:/~\+#]*[\s\w\-\@?^=%&/~\+#])?

?
 
Back
Top