![]() Topic awaiting preservation: perl directories RE (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
![]() 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 |
![]() to quote perl.com http://www.perl.com/doc/manual/html/pod/perlre.html quote:
|
Nervous Wreck (II) Inmate From: |
![]() 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 |
![]() well... Why do you do this with regexps anyhow. |