[Tutor] need help with a regular expression
rdmoores at gmail.com
Sat Jun 28 13:44:49 CEST 2008
On Sat, Jun 28, 2008 at 2:15 AM, Kelie <kf9150 at gmail.com> wrote:
> I'm trying to write a regular expression to filter strings that meet the
> following criteria:
> 1. Starts with 0-3 underscores;
> 2. Followed by one letter;
> 3. Then followed by 0 or more letters or digits or hyphens('-'),
> 4. Ends with one letter or digit; and
> 5. There should not be more than one continuous hyphens.
I'm not sure of your 5th condition. Do you mean, "A hyphen should not
be immediately followed by a hyphen"? Could you give examples of what
you will permit, and will not permit?
> This is what I have so far. I think it meets all the criteria except for the
> last one. Haven't figured out the answer yet.
More information about the Tutor