Re: [PHP-WIN] String Help

2003-11-06 Thread Herhuth, Ron
Thank You! I appreciate all of the quick replies...you guys rock! Ron >From: Ignatius Reilly >To: Herhuth, Ron; [EMAIL PROTECTED] >Sent: 11/06/2003 9:21 AM >This seems to work: > >$pattern = "/(\w+) (?:(?:\w\.|\(\w+\))) (\w+)/" ; >$replacement = "\$1 \$2" ; > >//$string = "John D. Smith" ; >$s

RE: [PHP-WIN] String Help

2003-11-06 Thread Svensson, B.A.T. (HKG)
Do you have control on the input data? E.g. are or are not the input originated from the entropy source known as end users? -Original Message- From: Herhuth, Ron To: [EMAIL PROTECTED] Sent: 2003-11-06 14:54 Subject: [PHP-WIN] String Help I have an instance where I am trying to remove a c

Re: [PHP-WIN] String Help

2003-11-06 Thread Ignatius Reilly
This seems to work: $pattern = "/(\w+) (?:(?:\w\.|\(\w+\))) (\w+)/" ; $replacement = "\$1 \$2" ; //$string = "John D. Smith" ; $string = "Joanne (Taylor) Smith" ; echo preg_replace( $pattern, $replacement, $string ) ; HTH Ignatius _ - Original Message - From: "