![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: Display the extracted ID in ID: tag before AU: tag and problem in capitalizing first letter in each wordby ELISHEVA (Prior) |
on Mar 21, 2011 at 11:57 UTC ( #894480=note: print w/replies, xml ) | Need Help?? |
--why the code still not working The short answer to your question is that you are trying to do way too much in a single regular expression. Try breaking down the problem into smaller steps. First get a program that does what you want with the lines beginning with AU. When you get that right, then and only then expand the program to also replace ids. Even doing the right thing with lines that begin with AU can be broken down into single steps. You don't need to select the lines beginning with 'AU' and do the substitutions and insert "Written by" all in one go. Instead break it down into steps:
Here is a part of your problem broken down into smaller steps. You might find substr especially helpful. It can be used on the left side to replace parts of a string.
In Section
Seekers of Perl Wisdom
|
|