On 2009-02-04 01:36:59 -0500, Chris R Miller <[email protected]> said:

Unfortunately, they aren't in sequential order in the ASCII table, so it's not as simple as determining if char c is numeric:

if ( c > '0' && c < '9' ) // c is numeric

Therefore, it's useful for searching quickly, without getting into the potential mess that could be a regular expression search. Well, I'm sure for a lot of people it'd be shorter and more concise, but my relative ineptitude with regular expressions would make it far more bothersome for me. Am I here to write a language, or to teach myself regular expressions?

Perhaps it's offtopic in a D forum, but you should use the class NSCharacterSet for that if you want to be efficient. There's a couple of methods in NSString accepting NSCharacterSet too which you may be interested in if you're writing a parser.


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to