RegEx Error - Unexpected '='?

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

RegEx Error - Unexpected '='?

Post by cbrian »

Parse error: parse error, unexpected '=' in /home/stlawren/www/cbc/KoD/game/header.php on line 13

Code: Select all

$bb-replace = array ('#(\[link=)(.+)(\])(.+)(\[\/link\])#','#(\[img=)(.+)(\])#','#(\[profile=)(\d+)(\])(.+)(\[\/profile\])#','#(\[color=)(.+)(\])(.+)(\[\/color\])#');
$bb-replacements = array ('<a href="\\2">\\4</a>','<img src="\\2" />','<a href="game.php?where=profile&$thestamp&who=//2">//4</a>','<font color="//2">//4</font>');
Line 13 and 14. If I comment out 13, I get an error on 14. Do you see a problem?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your variable names are illegal.
Post Reply