in reply to Regular Expression I think.
I'm assuming that you mean that you have a list built sorta like this:
If you wish to change the text, you'd start off with this regular expression:@listA = ('This=That', 'Some=Song'); @listB = ('Other=That', 'Corny=Song');
This will replace everything up to the equal sign with the text in $new_text. Now, to adapt it to modify the items in your arrays:$text =~ s/.+?=/$new_text=/;
The trailing = sign after $new_text is necessary because my pattern (trying to keep it simple) also included an equal sign. You could just as easily do this:foreach (@listA, @listB) { # or just one of the two, whatever # set $new_text to whatever you want s/.+?=/$new_text=/; }
Hope this answers your question.s/.+?(?==)/$new_text/;
|
|---|