Re: RegExp split for Spell Check
Thomas 'PointedEars' Lahn wrote:
Hanged if I can think of a good reason why, but well spotted, Thomas,
this is more efficient in any case:
alert('<font face="arial" size=2>test</font><p>yo this is a
test'.split(/\s(?![^<]*>)|<p>/).join("\n"));
Thomas 'PointedEars' Lahn wrote:
pr wrote:
^^^^^^^
| I need a pattern that will split without replacing.
>
> alert('<font face="arial" size=2>test</font><p>yo this is a
>test'.replac e(/\s(?=[^<]*>)/g, "~").split(/<p>|\s/).join("\n"));
>test'.replac e(/\s(?=[^<]*>)/g, "~").split(/<p>|\s/).join("\n"));
| I need a pattern that will split without replacing.
>
this is more efficient in any case:
alert('<font face="arial" size=2>test</font><p>yo this is a
test'.split(/\s(?![^<]*>)|<p>/).join("\n"));
Comment