Reg Exp Help

From: Date: Tue, 22 Oct 2002 18:37:47 +0000
Subject: Reg Exp Help
Groups: php.general 
Request: Send a blank email to php-general+get-120960@lists.php.net to get a copy of this message
I am having difficulty with creating a regular expression. I would like the reg exp to remove anything other than alphas, dashes, and spaces. For example, $data_array["cus01a"] = "Charles A. O'Brian-Brown, Jr."; if (!empty($data_array["cus01a"])) $cus01a = eregi_replace("[^a-zA-Z\-]|^[[:space:]]", "", $data_array["cus01a"]); echo $data_array["cus01a"]; This result produces, "CharlesAOBrian-BrownJr". I want it to produce "Charles A OBrian-Brown Jr". Any thoughts... Regards. _________________ Zach Curtis Programmer Analyst POPULUS www.populus.com _________________ Confidentiality Statement: This e-mail message and any attachment(s) are confidential and may contain proprietary information that may not be disclosed without express permission. If you have received this message in error or are not the intended recipient, please immediately notify the sender by replying to this message and then please delete this message and any attachment(s). Any use, dissemination, distribution, or reproduction by unintended recipients is not authorized. Thank you.

« previous php.general (#120960) next »