>>  If I got that right, you could even mark the second group to be skipped
>by
>>  adding a colon:
>>
>>  sHtml.replace(/(<td>[^<]+)(:\r\n)(.+</td>)/gi, "$1$2")
>
>The syntax requires a question mark: (?:...)

I find that skip syntax confuses me, but that's a personal preference. I
only use it when I absolutely need it.

>sHtml = sHtml.replace(
>    /(<td>)(.*\r?\n(?:.|\r?\n)*)(<\/td>)/gi,
>    function ($0, $1, $2, $3) {
>        return $1 + $2.replace(/\r?\n/g, "") + $3;
>    }
>);

Just a note, that syntax is not supported by all browsers. I believe Safari
does not support the call back function. I know I recently tried using that
syntax to fix a problem and found one of the major browsers that I needed to
support didn't support the syntax.

-Dan

Reply via email to