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) = (
		'Newbie',
		'Newbie Is',
		'A Newbie', 
		'A Newbie Not',
		'Newbie do be Newbie',
	);

foreach my $foot (@gerbal) {
	print "$foot -- ";
	if ($foot =~ /Newbie$/) {
		print " match found.\n";
	} else {
		print " no match.\n";
	}
}
exit;

Results:
Newbie --  match found.
Newbie Is --  no match.
A Newbie --  match found.
A Newbie Not --  no match.
Newbie do be Newbie --  match found.


Return to main thread