in reply to Pattern matching fields with variable or NULL data
Here's a couple of guesses at what you want:
/\d{0,3}/
matches:
"123"
" 123"
"123 "
" 123 "
"foo123bar"
doesn't match:
"1 2 3"
/^\s*\d{0,3}\s*$/
matches:
"123"
" 123"
"123 "
" 123 "
doesn't match:
"foo123bar"
"1 2 3"
/^\s*(?:\d\s*){0,3}$/
matches:
"123"
" 123"
"123 "
" 123 "
" 1 2 3 "
doesn't match:
"foo123bar"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pattern matching fields with variable or NULL data
by Anonymous Monk on Oct 27, 2004 at 00:57 UTC | |
by Anonymous Monk on Oct 27, 2004 at 01:05 UTC | |
by BrowserUk (Patriarch) on Oct 27, 2004 at 01:53 UTC | |
by ikegami (Patriarch) on Oct 27, 2004 at 06:48 UTC | |
by ikegami (Patriarch) on Oct 27, 2004 at 06:44 UTC |