Match First Sequence in Regular Expression?



Say I have some string that begins with an arbitrary sequence of characters
and then alternates repeating the letters 'a' and 'b' any number of times,
e.g.

"xyz123aaabbaabbbbababbbbaaabb"

I'm looking for a regular expression that matches the first, and only the
first, sequence of the letter 'a', and only if the length of the sequence is
exactly 3.

Does such a regular expression exist? If so, any ideas as to what it could
be?

--
Roger L. Cauvin
nospam_roger@xxxxxxxxxx (omit the "nospam_" part)
Cauvin, Inc.
Product Management / Market Research
http://www.cauvin-inc.com


.



Relevant Pages

  • Re: Grammar States and Tertiary Phonemes
    ... can be 'described' by a sequence of ... decimal base numbering system has 10 letters in its 'alphabet': ... Then, we derive a *grammar*, which is effectively a set of both ...
    (soc.religion.islam)
  • Re: Match First Sequence in Regular Expression?
    ... > Roger L. Cauvin wrote: ... >> characters and then alternates repeating the letters 'a' and 'b' any ... >> first, sequence of the letter 'a', and only if the length of the sequence ...
    (comp.lang.awk)
  • Re: Match First Sequence in Regular Expression?
    ... but the second test case I listed contained a typo. ... >>contained a sequence of three of the letter 'a'. ... The requirements are not met by your regular expression, ... Cauvin, Inc. ...
    (comp.lang.python)
  • Re: Lennys Counter Argument
    ... "Not beyond very low levels of functional complexity this is by no ... "It is very much like adding letters to growing English-language ... sequence, like I or It, and then add another letter and have it be ... can fairly quickly produce a sequence of over a dozen characters. ...
    (talk.origins)
  • Re: Match First Sequence in Regular Expression?
    ... Roger L. Cauvin wrote: ... >>> I'm looking for a regular expression that matches the first, ... >>> first, sequence of the letter 'a', and only if the length of the sequence ...
    (comp.unix.questions)