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', 
		'Nbwbie', 
		'Newbie', 
		'Niwbie',
		'Niwbee',
		'Nmwbie',
		'Nowbie',
		'Nuwbie',
	);

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

Results:

Nawbie --  no match.
Nbwbie --  match found.
Newbie --  no match.
Niwbie --  no match.
Niwbee --  no match.
Nmwbie --  match found.
Nowbie --  no match.
Nuwbie --  no match.


Return to main thread