Newbie dot Org HomePage
Visit one of our web buddies
Regular Expressions
Sample / Examples
Return to main thread

#!/usr/bin/perl
use strict;

my (@gerbal) = (
		'Nawbie', 
		'Nebwbie', 
		'Neeioaawbie', 
		'NeeiRaawbie',
	);

foreach my $foot (@gerbal) {
	print "$foot -- ";
	if ($foot =~ /N[aeiou]+wbie/) {
		print " match found.\n";
	} else {
		print " no match.\n";
	}
}
exit;

Results:

Nawbie --  match found.
Nebwbie --  no match.
Neeioaawbie --  match found.
NeeiRaawbie --  no match.


Return to main thread