in reply to Regular Expression Help
Your missing the anchors, and the /g, the /i and the parens are unnecessary:
/^\w+\.\w{3}$/
But that's not perfect because \w allows for digits, so:
/^[a-zA-Z_]+\.[a-zA-Z_]{3}$/
To allow filenames with no extention or with extentions short than 3 characters:
/^[a-zA-Z_]+(?:\.[a-zA-Z_]{0,3})?$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expression Help
by Anonymous Monk on Jan 06, 2006 at 16:32 UTC | |
by ikegami (Patriarch) on Jan 06, 2006 at 16:46 UTC | |
by Anonymous Monk on Jan 06, 2006 at 16:48 UTC | |
by thedoe (Monk) on Jan 06, 2006 at 19:11 UTC |