[PHP] preg_replace problem

2009-06-13 Thread Al
This preg_replace() should simply replace all with amp; unless the value is already amp; But; if $value is simple a quote character [] I get quote. e.g., test = quote;testquote; Search string and replace works as it should in Regex_Coach. echo $value.'br /';

[PHP] preg_replace problem (or possibly bug)

2006-03-08 Thread Michael
I am currently writing a forum system, but at the moment I have a bug that no one can seem to get to the root cause of. Basically I am using preg_replace with the pattern as '\[url=(.*?)\](.*?)\[/url\]'is. However for most links it works fine but for others it just doesn't render the bbcode to a

Re: [PHP] preg_replace problem (or possibly bug)

2006-03-08 Thread Anthony Ettinger
On 3/8/06, Michael [EMAIL PROTECTED] wrote: I am currently writing a forum system, but at the moment I have a bug that no one can seem to get to the root cause of. Basically I am using preg_replace with the pattern as '\[url=(.*?)\](.*?)\[/url\]'is. However for most links it works fine but for

[PHP] preg_replace problem

2006-03-01 Thread Benjamin Adams
$file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate =

Re: [PHP] preg_replace problem

2006-03-01 Thread Chris
Benjamin Adams wrote: $file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate =

Re: [PHP] preg_replace problem

2003-06-24 Thread Wendell Brown
On Tue, 17 Jun 2003 07:25:00 -0400, Vincent Bouret wrote: I want A dog jumped over a ladder to become xyzA/xyz dog jumped over xyza/xyz ladder. How about this... $str = A dog jumped over a ladder; $str = preg_replace( /(^| )(a)( |$)/i, $1xyz$2/xyz$3, str ); -- PHP General Mailing List

[PHP] preg_replace problem

2003-06-17 Thread Vincent Bouret
Hi, I am having this problem with preg_replace. I want the following thing but I can't understand what regular expression I should put. I want to replace all occurences of a given **whole** word into a string. For example: I want A dog jumped over a ladder to become xyzA/xyz dog jumped over

Re: [PHP] preg_replace problem

2003-06-17 Thread Marek Kilimajer
You need \b = word boundary. $string=preg_replace(/\\b($word)\\b/i,'xyz\1/xyz', $string); Vincent Bouret wrote: Hi, I am having this problem with preg_replace. I want the following thing but I can't understand what regular expression I should put. I want to replace all occurences of a given

Re: [PHP] preg_replace problem

2003-06-17 Thread Stefan Dengscherz
Hello, ?php $parsed = preg_replace(/(\ba\b)/i,tag\\1/tag,$sourcestring); ? should do the job. regards Am Die, 2003-06-17 um 13.25 schrieb Vincent Bouret: Hi, I am having this problem with preg_replace. I want the following thing but I can't understand what regular expression I

[PHP] preg_replace problem.

2002-02-17 Thread Paul Roberts
where am i going wrong i used $mail = preg_replace(/p[^]*?/i,\n\n$0, $mail,-1); and $mail = preg_replace(/p[^]*?/i,\n\n\\1, $mail,-1); but i get $0 or \1 inserted, but only on the linux server not on my win 2000 dev machine! Paul Roberts [EMAIL PROTECTED] -

[PHP] preg_replace problem

2001-01-18 Thread The Captain
I have a regular expression that's not giving me the results i really need. I have a bunch of strings coming at me that need to be truncated if they're over 15 characters... but not to truncate until after it reaches the first word. This regular expression just doesn't seem to want to work