Double letters?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Double letters?

Postby DFH » Sun May 13, 2012 1:51 am

Hi Simon,

Is there an easy method to search for double letters?

David

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Double letters?

Postby DataMystic Support » Mon May 14, 2012 12:55 pm

Yes David,

Just use a perl pattern of

Code: Select all

([a-z])\1
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Double letters?

Postby DFH » Tue May 15, 2012 12:31 am

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

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Double letters?

Postby DataMystic Support » Tue May 15, 2012 8:31 am

Hi David,

[a-z]{2} will find two letters, what I wrote first does in fact work!
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Double letters?

Postby DFH » Wed May 16, 2012 1:53 am

How amazing!

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

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Double letters?

Postby DataMystic Support » Wed May 16, 2012 8:32 am

\1, \2 etc in perl parlance refer to the previously matched text in captured sub-pattern 1, 2 etc.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 1 guest