|
Posted by Schroeder, AJ on 11/05/07 19:11
Hello group,
I am attempting to remove double quotes from the beginning and ending of a
string. Admittedly, I am not the best with regular expressions, but I do
have two that work with preg_replace(). Here they are:
$pattern = '[^"]'; <--- removes the beginning double quote
$pattern = '["$]'; <--- removes the ending double quote
But when I try to make this all one statement with:
$pattern = '[^"].*["$]';
PHP throws a warning with an unknown modifier '.'. I then tried to enclose
'.*' in parentheses and I get an unknown modifier '('.
This is getting beyond my regex knowledge, if anyone has any advice on this
it would be greatly appreciated.
Thanks in advance,
AJ Schroeder
[Back to original message]
|