SouKenji has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am trying to do a bit of search and replace and for the life of me, I cannot figure out what I am doing wrong.
I have tried multiple iterations, ending with g, ge, r, re, but nothing seems to work. I always get the same output as my input.
Here is my current code etc:
$line= "F:\MF\BR\PreparedSources\acdv\test_dev\BeanName\SessionBean.RMWAppException.java"
if ($line=~ m/.java/) { $line=~ s/^(f:\\MF\\BR\\PreparedSources\\)([a-z]+\\)([a-z]+_dev)(\\) +([a-z]+)(.java)$/JAVAFILE "$4$5$6" "$2" "##All"/}</p>
Essentially, I want to take the text in $line and transform it to:
JAVAFILE "test_dev\BeanName\SessionBean.RMWAppException.java" "acdv" "##All"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and replace help.
by philipbailey (Curate) on Jul 10, 2011 at 21:12 UTC | |
by SouKenji (Novice) on Jul 10, 2011 at 21:21 UTC | |
|
Re: Search and replace help.
by Anonymous Monk on Jul 10, 2011 at 21:10 UTC | |
by SouKenji (Novice) on Jul 10, 2011 at 21:16 UTC | |
by Anonymous Monk on Jul 10, 2011 at 21:38 UTC |