Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > regexp character classes and +

Reply
Thread Tools

regexp character classes and +

 
 
Mark Volkmann
Guest
Posts: n/a
 
      08-25-2005
On page 71 of Pickaxe 2, discussing character classes, it says "The
significance of special regular expression characters (including +) is
turned off inside the brackets."

Why is this a valid regular expression (+ not the first character in
the character class)

%r{^[-+*/]$}

but this isn't? (+ is the first character in the character class)

%r{^[+-*/]$}

--=20
R. Mark Volkmann
Partner, Object Computing, Inc.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[regexp] How to convert string "/regexp/i" to /regexp/i - ? Joao Silva Ruby 16 08-21-2009 05:52 PM
Ruby 1.9 - ArgumentError: incompatible encoding regexp match(US-ASCII regexp with ISO-2022-JP string) Mikel Lindsaar Ruby 0 03-31-2008 10:27 AM
Programmatically turning a Regexp into an anchored Regexp Greg Hurrell Ruby 4 02-14-2007 06:56 PM
RegExp.exec() returns null when there is a match - a JavaScript RegExp bug? Uldis Bojars Javascript 2 12-17-2006 09:59 PM
REGEXP: Creating character classes basi Ruby 1 08-06-2005 09:45 PM



Advertisments