I'm trying to use reg.exp. to isolate part of a query. Example query:
"domain:mydomain.com other query"
I would like to isolate the part "mydomain.com", excluding the trailing "other query". Ideally this should work even if the query is structure like this:
"other query domain:mydomain.com"
This is as far as I've gotten (copying from other scripts). If there is a better - more elegant - way to do this I am all ears.
$pattern = "`domain:([a-z0-9_.-])`sieU";
$replacement = "'$1'";
$domain = preg_replace($pattern, $replacement, $query);
Could someone also explain what the "sieU" in the pattern does?
Thanks in advance.
[edited by: coopster at 10:57 pm (utc) on July 24, 2006]