Forums / Craftwork / Server-side / preg_replace questions

I'm going mad atm, trying to figure it out?

GHengeveld
#34723 2012-06-18 20:59

I think what you're looking for is something like this:

$var = preg_replace('/!([^\s])/', '<a href="index.php?e=users&m=details&u=$1">$1</a>', $var);

A helpful tool to check your regular expressions is here: http://gskinner.com/RegExr/

By the way, don't you think the @ sign is more appropriate (considering Twitter's usage of this).