Hi Alex,
Thanks for the response. I have just enough basic RE knowledge to do as
you did. :) Where I got stuck (and remain stuck) was when I tried to be
extra clever and ambitious and try to match any pattern containing
(same) repeating character spaced by any character(s) without having to
be specific about what character would be repeated.
i.e.
instead of:
(A.){10} --"A" paired with "wildCharacter" repeated 10 times
I'm looking for:
(AnyRepeatedCharacter.){10} --"AnyRepeatedCharacter" paired with
"wildCharacter" repeated 10 times...where "AnyRepeatedCharacter could
be (pulling from my original examples) A, % or \$, etc.
I spent a good amount of time with the books and banging around the web
yesterday and couldn't crack this one.
Gilles
On Jun 11, 2005, at 6:08 AM, Alex da Franca wrote:
Am 10.06.2005 um 19:32 schrieb 2702NET:
Hi All,
Sorry for the slightly OT posting.
Don't have much experience in the way of Regular Expressions and not
finding anything obvious in PregEx Xtra documentation, my books or on
the web. Wondering if one of you folks might be able to point me in
the right direction.
What is the Regular Expression for matching a particular number of
any repeated character - each of the same character repeats spaced by
any other, wild character?
What I'm looking for:
Say we're looking for 10 repeats of the same (of any) character (the
repeated character being the first in the string) each of the
character repeats "spaced" by any character. The RegExp might return:
that should be:
(A.){10}
match 10 times the literal "A" and any other char (.)
"A&A&A.A.A:A:A:ABA(A(A("
(A is the repeating character)
or
"%^%^%^%*%l%>%>%>%>%%"
(% is the repeating character)#
(%.){10}
or
"$%$%$%$%$%$%$%$%$%$0"
($ is the repeating character)
(\$.){10}
the $ must be escaped
---------------------------
|||
a�ex
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list,
email [email protected] (Problems, email
[EMAIL PROTECTED]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]