Slow Regexps
Its often beneficial to replace regular expressions with simpler functions
that have the same effect.
With Regular Expression
<?php
if (preg_match ('/(.*)\@(.*)/', $data, $matches)) {
print $matches[2];
}
? >
Without Regular Expressions
<?php
$pos = strrpos ('@', $data);
if ($pos !== false) {
print substr ($data, $pos);
}
? >
Fast Regexps
In other cases it may help to use regular expressions instead of custom parse
routines in your PHP code.