Re: [PHP] eregi_replace driving me nuts

2004-07-09 Thread Matt M.
> What I'm trying to do: > > I'm trying to have the proper variables for the eregi_replace so that each > word in the $dico array is replaced by a link to its definition respecting > the following rules : > -only exact match makes a link to the definition, for example : > - "abaisseraient" do

[PHP] eregi_replace driving me nuts

2004-07-09 Thread Michael . Thanry
Hi, Considering the following script : "def.php?id=9", "singer" => "def.php?id=9" ); $texte = "Abaisser Vous abaisserez la pate, abaisser.Singer"; while(list($mot,$def) = each($dico)) { $pattern = "(".$mot.")[^[:alpha:]]"; ech

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Chris Shiflett
In a weak attempt at improving my knowledge of regular expressions, I came up with a less elegant solution than Dan's. :-) $os=eregi_replace("Win([^0-9NT]*)", "Windows \1" $os); This adds some additional handy replacements, such as: Winblows98 -> Windows 98 Windoze98 -> Windows 98 It's a dece

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Analysis & Solutions
On Tue, Jul 09, 2002 at 10:40:33PM -0500, Chris Shiflett wrote: > Patrick Teague wrote: > > >$os = eregi_replace( "Win[^dows]", "Windows ", $os ); > > I'm pretty sure (I'm not a regular expression expert) this matches "a > string that begins with Win followed by a character that is not d, o, w,

Re: [PHP] eregi_replace driving me nuts

2002-07-09 Thread Chris Shiflett
Patrick Teague wrote: >For some reason the following line is not behaving > >$os = eregi_replace( "Win[^dows]", "Windows ", $os ); > I'm pretty sure (I'm not a regular expression expert) this matches "a string that begins with Win followed by a character that is not d, o, w, or s. Thus, in th

[PHP] eregi_replace driving me nuts

2002-07-09 Thread Patrick Teague
Hello, For some reason the following line is not behaving $os = eregi_replace( "Win[^dows]", "Windows ", $os ); this should take any form of Win9x (or WinNT, or Win2k, etc) & convert it so it shows Windows 9x (or Windows NT, or... you get the picture). After running "Win98" through the above