PCRE requires delimiters that separate the actual regular expression from optional modifiers. With PHP you can use any non-alphanumeric, non-backslash, non-whitespace character and even delimiters that come in pairs (brackets).
In your case the leading (
is used as delimiter and the first corresponding closing )
marks the end of the regular expression; the rest is treated as modifiers:
([http://some.url.com/index.php?showtopic=\"]*)([0-9]+(?:\.[0-9]*)?)
^ ^
But the first character after the ending delimiter ((
) is not a valid modifier. That why the error message says Unknown modifier '(
'.
In most cases /
is used as delimiter like in Perl. But that would require to escape each occurrence of /
in the regular expression. So it’s a good choice to choose a delimiter that’s not in the regular expression. In your case you could use #
like BoltClock suggested.
Oh, and by the way: A character class like [http://some.url.com/index.php?showtopic=\"]
represents just one single character of the listed characters. So either h
, t
, p
, :
, /
, etc. If you mean to express http://some.url.com/index.php?showtopic="
literally, use just http://some\.url\.com/index\.php\?showtopic="
(don’t forget to escape the meta characters).