Current location: Hot Scripts Forums » Programming Languages » PHP » HELP!!! - Invalid preceding regular expression


HELP!!! - Invalid preceding regular expression

Reply
  #1 (permalink)  
Old 01-03-05, 07:07 PM
CMIVXX's Avatar
CMIVXX CMIVXX is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
HELP!!! - Invalid preceding regular expression

Anyone know what the heck this means?

Code:
Warning: Invalid preceding regular expression in /user1/xxxx.xxx/contact_mailer.php on line 19
Here's the code:

Code:
while ($domail <= $nr_mail):
	if ($domail == 1) $var2use = $arr_t1; else $var2use = $arr_t2;

		for ($index = 0; $index < count($var2use); $index++)
			{
			$pattern = ereg("{{[A-z0-9_]*}}", $var2use[$index]);  (line 19)
			if  ($pattern)
				{
				$line = ereg_replace("{{","$",$var2use[$index]);
				$line = ereg_replace("}}","",$line);
				}
			else
				{
				$line = $var2use[$index];
				}
				$line = addslashes($line) . "<br>";
				eval( "\$line = \"$line\";" );
				if ($index == 0 && $domail == 1) $linetot1 = $line;
				elseif ($index > 0 && $domail == 1) $linetot1 .= $line;
				if ($index == 0 && $domail == 2) $linetot2 = $line;
				elseif ($index > 0 && $domail == 2) $linetot2 .= $line;
			}

	++$domail;

endwhile;

Any help would be appreciated as this has straight stumped me. Thanks.
__________________
--------------
CMIVXX

Last edited by CMIVXX; 01-03-05 at 07:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-04-05, 04:55 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
try replacing line 19 with:
PHP Code:

$pattern preg_replace("~\{\{[A-z0-9_]*\}\}~"$var2use[$index]); 

the braces are used in regexp to specify ranges, so you have to escape them ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I want a crowler and abstraction from Regular Expression oiranoinu Script Requests 4 11-26-04 12:31 AM
Regular Expression IP Address Replacement CMIVXX PHP 3 11-20-04 08:27 AM
Regular Expression Problem birdy Visual Basic 0 10-04-04 03:09 PM
calendar working until months changed bitesize JavaScript 1 01-13-04 02:50 PM
suggest a regular expression gmadhukarreddy Perl 2 01-08-04 01:56 AM


All times are GMT -5. The time now is 09:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.