V
VK
If it was already answered somewhere, I'll be glad to be pointed to
(after the necessary comments on my search abilities
I need as booletproof as possible way to strip out whitespaces from
between tag borders in the source code.
1) left border defined by gt sign >
2) right border defined by lt sign <
3) If the content between left and right borders consists only of white
spaces it has to be removed.
4) Content consists of white spaces only if it contains only \n, \r,
\t, \f, space (\u0020) in any amount and any combinations.
Note: NON-BREAKING SPACE (nbsp, \u00A0) is /not/ a whitespace
character.
Thus say the outcome from:
<foo>
<bar>Foobar</bar>
</foo>
will be:
<foo><bar>Foobar</bar></foo>
Anyone knows of a similar RegExp?
(after the necessary comments on my search abilities
I need as booletproof as possible way to strip out whitespaces from
between tag borders in the source code.
1) left border defined by gt sign >
2) right border defined by lt sign <
3) If the content between left and right borders consists only of white
spaces it has to be removed.
4) Content consists of white spaces only if it contains only \n, \r,
\t, \f, space (\u0020) in any amount and any combinations.
Note: NON-BREAKING SPACE (nbsp, \u00A0) is /not/ a whitespace
character.
Thus say the outcome from:
<foo>
<bar>Foobar</bar>
</foo>
will be:
<foo><bar>Foobar</bar></foo>
Anyone knows of a similar RegExp?