Topic awaiting preservation: perl directories RE |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 01-02-2004 19:40
I have a list of directories that I need to change from /foo/bar to ../../ (for each folder, I want to replace the scalar with ../ ) |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-02-2004 21:52
to quote perl.com http://www.perl.com/doc/manual/html/pod/perlre.html quote:
|
Nervous Wreck (II) Inmate From: |
posted 01-03-2004 02:37
That looks like what I need, but I am still having trouble. I think I am overcomplicating the RE. I want to replace ever /foo with ../ code: $img_path =~ s/(\/.*?)(.*)/\.\.\/$2/g; thanks |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-03-2004 10:56
well... Why do you do this with regexps anyhow. |