PHP - Empty Regular Expression
Linc
OwnerDetroit Icrontian
I've been battling this error for a few hours now...
Warning: Empty regular expression on line 84 (the last one listed here)
[php]$document = implode("", $member_array);
$search = array("'[" . $col_delim . "]+'", "'[" . $row_delim . "]+'", "\t", "'\"'");
$replace = array(" ", " ", $col_delim, "\\" . chr(34));
$tmp_text = preg_replace($search, $replace, $document);[/php]
I can't figure out why it's doing this... anyone have an idea?
Warning: Empty regular expression on line 84 (the last one listed here)
[php]$document = implode("", $member_array);
$search = array("'[" . $col_delim . "]+'", "'[" . $row_delim . "]+'", "\t", "'\"'");
$replace = array(" ", " ", $col_delim, "\\" . chr(34));
$tmp_text = preg_replace($search, $replace, $document);[/php]
I can't figure out why it's doing this... anyone have an idea?
0
Comments
It's not always necessary to use a regex unless you have specific characters you wish to filter
If that doesn't work then make the / a /i and see if that works.
You also might need to make the [ a \[
$row_delim = "/";[/php]
Suffice to say member_array is a long array of words and numbers so document is a long string. I've done "print"s on all 3 and they are the correct values.
What other info did you want?
Those reg experessions I took from Lasse - they've been working for quite a while which is why I don't get this.
a2j - I tried the first and got another error: Unknown modifier ']' You want me to put an 'i' after every slash?