in reply to replace string
You forgot to mention what's not working
In your case it is a missing line
__DATA__
right before the example data, and a regex you might change to
s/<([^>]*)>/\{$1\}\n/g;
or alternatively
s/<(.*?)>/\{$1\}\n/g;
Note that this is probably still short of what you want, since you seem to need to throw away ending tags. In that case you could add '/' to the character class above and throw away the ending tags in a second regex
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: replace string
by vitoco (Hermit) on Aug 19, 2009 at 14:42 UTC |