regex question
János
janos.lobb at yale.edu
Thu Apr 5 11:36:23 PDT 2007
On Apr 5, 2007, at 1:25 PM, Dan Shoop wrote:
> At 11:31 AM -0400 4/5/07, János wrote:
>> Hi,
>>
>> I need a pointer to a documentation that describe well the
>> extended regular expressions.
>>
>> I need to match some strings that must start with any of 'S', 'A',
>> 'C' or 'N', followed by two digits followed by a '-' /dash/,
>> followed by one to six digits.
>>
>> So I created the following one:
>>
>> "^[ACNS][0-9]{2}-[0-9]+$"
>>
>> I am not so sure that it really fixes the dash to the 4th position
>> and it definitely would allow more than 6 digits at the end.
>>
>> Any good advise ?
>
> What's wrong with the O'Reilly book?
>
> www.oreilly.com/catalog/regex2/
> --
It is not in books24x7 where I have "free" access :) Otherwise nothin'.
But as I was hunting for it in books24x7 I found this book:
<snip>
Regular Expression Recipes: A Problem-Solution Approach
by Nathan A. Good
Apress © 2005 (320 pages)
ISBN:159059441X
This useful reference provides you with all the open source regular
expressions you'll ever need, and explains how to use each one. This
way, you can learn by example, rather than muddling through endless
pages of syntax explanations.
</snip>
that I will revisit in the coming days looks like.
Thanks anyway,
János
More information about the MacOSX-admin
mailing list