Mark Tolonen gmail.com> writes:
> re.compile(r'^_{0,3}[A-Z](?:[A-Z0-9]|-(?!-))*[A-Z0-9]$') # if rule 4 is an
> additional letter or digit
> re.compile(r'^_{0,3}[A-Z](?:[A-Z0-9]|-(?!-))*(? single-letter strings are allowed
>
Mark, single-letter strings are allowed and your regular expression w
Dick Moores gmail.com> writes:
> 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?
Dick, your are correct. A hyphen should not be immediately followed by a hyphen.
"Kelie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
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
On Sat, 2008-06-28 at 17:39 +0200, Andre Engels wrote:
> On Sat, Jun 28, 2008 at 3:21 PM, Lie Ryan <[EMAIL PROTECTED]> wrote:
>
> > > I think
> > >
> > > _{0,3}[A-Z](\-?[A-Z0-9])+
> > >
> > > will do what you are looking for.
> >
> > That, doesn't allow single hyphen, which his requirement al
On Sat, Jun 28, 2008 at 3:21 PM, Lie Ryan <[EMAIL PROTECTED]> wrote:
> > I think
> >
> > _{0,3}[A-Z](\-?[A-Z0-9])+
> >
> > will do what you are looking for.
>
> That, doesn't allow single hyphen, which his requirement allowed as long
> as it (the hypehn) is not as the first or last character.
>> Hello,
>>
>> 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;
On Sat, Jun 28, 2008 at 11:15 AM, Kelie <[EMAIL PROTECTED]> wrote:
> Hello,
>
> 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 hyphen
Filter it. Use two re, one the one you've made, the other the double
hyphen filter:
pat2 = re.compile('.*?\-\-.*?')
If the string matches this re, then the string is rejected, if it DOES
NOT match (i.e. pat2.match('blah') returns None, i.e. if not
pat2.match('blah')), then it is accepted.
btw: Y
On Sat, Jun 28, 2008 at 2:15 AM, Kelie <[EMAIL PROTECTED]> wrote:
> Hello,
>
> 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
Hello,
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 o
10 matches
Mail list logo