shawn wilson wrote:

heh, i've got to learn to test my code before posting - i'm ending
looking like an idiot :)
*sigh* this is what i wanted to say:


#!/usr/bin/perl

use warnings;
use strict;

my $fields1 = "a little sentense with one and it will match with two\n";
my $fields2 = "this one will not match\n";

work( $fields1 );
work( $fields2 );

sub work {
    my( $fields ) = @_;

    my @match = ( qr/one/i, qr/two/i, qr/etc/i );
    my @words = split /\W+/, $fields;

Using \W means that numerical digits and the underscore character are part of your "word" character set. Is that what you really want?



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to