
davorg
Thaumaturge
/ Moderator
Jan 26, 2003, 11:10 PM
Post #3 of 4
(1616 views)
|
|
Re: [Jacko] Retrieving Matched Expression
[In reply to]
|
Can't Post
|
|
It matches zero or more non-digits followed by ".java". Is that what you wanted? You capture parts of a matched regular expression using parentheses. The captured parts will be in $1, $2, etc. if the match is sueccessful.
if (/(\D*)\.java/) { print "Name -s $1\n"; } -- Dave Cross, Perl Hacker, Trainer and Writer http://www.dave.org.uk/ Get more help at Perl Monks
|