Re: Regex to grab a Windows Path from a String...
| From: | Marek Kilimajer | Date: | Wed, 17 Dec 2003 12:38:33 +0000 |
| Subject: | Re: Regex to grab a Windows Path from a String... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172868@lists.php.net to get a copy of this message | ||
if(preg_match('/<img[^>]+src[ ]*=[ ]*(|"|\')[a-z]{1}:\\\/i', $string)) echo "local links used";
sumbry@sumbry.com wrote:
My regex skills are serious lacking and after scouring the net for relevant links I'm a bit stuck. I've got a textarea field where I pull user input from, and I'd like to search this entire field for a Windows Directory Path (ex. C:\Documents\Blah). Basically my users are allowed to specify HTML img tags in this textarea and I'd like to make sure that they don't reference any images that are on their local hard drive (which many of them are doing and then thinking the HTML that I generate from that actually works when it doesn't). Suggestions?