Topic: need a way to seacrh and move html tags in a string.... |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: you tell me |
posted 05-01-2007 16:18
Hi guys Im in a fix... code: stuff one <span style="blablaba">text tex <strong>somesome text </strong>more text more text </span> ending stuff
code: <span style="blablaba"><strong>stuff one text tex somesome text more text more text ending stuff</strong></span>
|
Paranoid (IV) Inmate From: Madison, Indiana |
posted 05-01-2007 18:27
What are you trying to do this with? If you're using a language like Perl you would be better off using a loop and a couple of expressions. For example: code: $leading = ""; $trailing = ""; while ($string =~ s/(<[^>]*>)//) { my $tag = $1; if ($tag =~ /<\//) { $trailing .= $tag } else { $leading .= $tag } } $string = $leading . $string . $trailing;
|
Bipolar (III) Inmate From: you tell me |
posted 05-01-2007 18:32
well actually I'm tweaking a plugin of tinymce javascript editor. I'm trying to make a plugin that imitates the actions of the format painter option in MS outlook - don't ask why, my boss just HAS TO HAVE THAT integrated. |