Hi Simon,
Is there an easy method to search for double letters?
David
Double letters?
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
-
- Posts: 988
- Joined: Sun Dec 09, 2007 2:49 am
- Location: UK
Re: Double letters?
Did you understand my question?
I want a simple method to find double letters, not just two letters that may or may not be the same.
(aa|bb|cc|dd ... |xx|yy|zz) would do it, but there must be a shorter pattern, surely.
David
I want a simple method to find double letters, not just two letters that may or may not be the same.
(aa|bb|cc|dd ... |xx|yy|zz) would do it, but there must be a shorter pattern, surely.
David
David
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Double letters?
Hi David,
[a-z]{2} will find two letters, what I wrote first does in fact work!
[a-z]{2} will find two letters, what I wrote first does in fact work!
-
- Posts: 988
- Joined: Sun Dec 09, 2007 2:49 am
- Location: UK
Re: Double letters?
How amazing!
I'm still struggling to understand how it does work.
David
I'm still struggling to understand how it does work.
Code: Select all
000084 aa
000018 ee
000406 ii
000021 oo
000009 ss
000009 uu
000223 vv
David
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Double letters?
\1, \2 etc in perl parlance refer to the previously matched text in captured sub-pattern 1, 2 etc.