Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 8th, 2007, 01:30 PM
Registered User
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Preg_replace not stripping exclamation marks

$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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 09:36 PM.

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