Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2007, 01:30 PM
Registered User
 
Join Date: Oct 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Preg_replace not stripping exclamation marks

Code:
<?php
$val = "Normal (and bold) text!!";
$newval = preg_replace('/[^A-z0-9 -\']/', '', $val)
echo $newval;
// Outputs "Normal and bold text!!"  
?>
Why is it doing this? Have I missed something? It should only be allowing what I've asked for in the pattern - I don't see any exclamation marks being allowed.

Thanks in advance


"A computer once beat me at chess, but it was no match for me at kick boxing" - Emo Philips





Similar Threads
Thread Thread Starter Forum Replies Last Post
preg_replace problem harpua PHP How-To 0 October 9th, 2007 03:59 PM
apostrophes or quotation marks crmpicco Javascript 6 March 21st, 2006 09:01 AM
Message box without the exclamation icon lian_a Javascript How-To 1 June 15th, 2005 06:54 AM
Paragraph marks SameerParker Beginning PHP 5 December 14th, 2004 05:25 AM
Spurious Exclamation Marks patwadd VBScript 0 November 18th, 2004 02:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.