From: Brian Candler Date: 2007-05-30T22:56:15+09:00 Subject: Re: Regexp to extract number with hyphen On Wed, May 30, 2007 at 10:40:09PM +0900, Ken Bloom wrote: > Others have suggested the following correction: > /(\d+)-?(\d+)/ That particular example matches 11, but not 1. The most important thing is to be clear about exactly what you want to allow to match or not match; then writing the regexp is easy.