> 
| Given the string:
|
| $a = "xxx xxx xxx xxx xxx xxx xxx (Jan 12 1990 ......)"
|
| I want to selectively extract that part of the string
| having the (Jan 12 1990 ...) and store it in an array.
| Can someone guide me?
:
: something like this should work...
: 
:       (@somearray) = split(/\(.*\)/, $a);
: 

Err... that split will not work as required.  It would
return the following:

$somearray[0] = "xxx xxx xxx xxx xxx xxx xxx ";
$somearray[1] = "";

since instead of the standard space, it'd take everything
from the first to the last brackets as the seperator!

The following should work as expected:

my ($date) = $line =~ /\(([^\)]+)\)$/;
my  @date  = split / /, $date;

Take care,

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to