Bryan Murdock wrote:
> Michael Ryan Byrd wrote:
> > eregi_replace("[^a-z]*Booty[^a-z]*","_\\0_","your Booty String Here");
> 
> I don't know how php does regexps really, 
> 
> s/([^a-zA-Z]*)Booty([^a-zA-Z]*)/\1NewBootyString\2/

PHP has a couple different ways of handling regexps. Bryan's
recommendation will run in preg_replace(), while Ryan's recommendation
will run in eregi_replace(). They're a little different. Here's how I
would implement Bryan's regexp in PHP:

$string = preg_replace( "/([^a-zA-Z]*)Booty([^a-zA-Z]*)/",
                        "_",
                        $string);

(or something like that) See the doc (of course) for more info on
preg_replace(): http://us2.php.net/preg_replace

--Dave

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to