Hello,
i want to parse a user input:
urls like:
http://www.xyz.com
should be changed into:
<a href="url">url</a>
and
image-urls like:
http://www.xyz.com/image.gif
should be changed into:
<img src="image-url">
i researched the reg exp:
[[:alpha:]]+://[<>[:space:]]+[[:alnum:]/]
for url-compilation
and:
[[:alpha:]]+://[<>[:space:]]+[[:alnum:]/]+.(gif|jpg)
for image-urls
the problems:
1) as u can see the reg exp for urls matches image-urls, too.
so it does not work to apply both...
2) how can in compile it aback (reg exp)?
any idea?