|
|
| Keep It Simple, Stupid | |
| PerlMonks |
(code) Re: (4) in-place edit, regex, one-liner (Mo' Betta)by ybiC (Prior) |
| on Nov 23, 2000 at 22:52 UTC ( [id://43180]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I like it, thanks chromatic. May I throw a slight curve in the fairway?
A quick dig in The Owl leads me to think something like this will match reference any image of alphanumeric name. How close am I? perl -i.bak -pe 's!(img src=")(\w+?\.(gif|jpg|jpeg|png)")!$1/Images/$2!g' *.html Update: The above one-liner was tweaked, and now works. Changes this:
To this: And saves original files as ".bak". cheers, Don striving for Perl Adept (it's pronounced "why-bick")
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||