![]() |
|
#1
|
||||
|
||||
Regular Expressions question.For an upcoming article on this site, I was testing out this regex that I came up with to extract urls off a text/string. see script below:
PHP Code:
Code:
the code works quite well except for the fact that it includes the last dot, just after the urls in any test string above. How to get a URL without the punctuation mark at the end of a URL? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#2
|
|||
|
|||
|
Hi,
I just tested the script out on my computer and I got a result that looked like this: Quote:
Anything wrong with that? I don't see any period. ![]() __________________
You're not supposed to be looking at this. |
|
#3
|
||||
|
||||
|
but what if you tried something like this: (remove the spaces I added in the urls before testing)
PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
||||
|
||||
|
after much caffeine and chewing on a used nicotine pack... i finally figured it out last night : PCRE Pattern - Extracting URLs
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about loading php into tables or css | pcxgamer | Web Design Forum | 6 | 17-Sep-2005 21:08 |
| a C input question.. | tmike | C Programming Language | 2 | 19-Sep-2003 02:39 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 02:31 |
| a noobish compiler question | Charunks | CPP / C++ Forum | 5 | 03-Sep-2003 02:18 |
| preg_replace + regular expression | EasyExpat | MySQL / PHP Forum | 4 | 10-Jul-2003 04:36 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The