
numberwhun
Novice

May 22, 2007, 9:58 AM
Post #2 of 2
(1870 views)
|
|
Re: [akhilak] regex helppppppppp!!!!!!
[In reply to]
|
Can't Post
|
|
Well, here is one way of doing it:
use strict; use warnings; my $words = "abc+, perl+, word, this, that+"; my @wordsArray = split(/\,\s*/, $words); foreach(@wordsArray) { print("$_ \n") if($_ =~ m/\w+\+$/); } Depending on how the words in the string are arranged (ie: with or without the commas and such), this could be easily modified to fit your needs. Regards, jlk "Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall" "Lack of planning on your part does not constitute an emergency for me!"
|