Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reg exp help

Status
Not open for further replies.

danny2785

Programmer
Jun 26, 2006
16
0
0
US
How would you tell if there are 5 consonants in a row in a word? Thanks
 
one obvious way:

Code:
my $word = 'aidcvfrtougtn';

if($word =~ /([bcdfghjklmnpqrstvwxyz]{5})/) {
   print "Found five in a row: $1\n";
}
else {
   print "No joy!\n";
}

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top