Re: [xsl] Finding first difference between 2 text strings

Subject: Re: [xsl] Finding first difference between 2 text strings
From: <mlcook@xxxxxxxxxx>
Date: Tue, 15 Sep 2009 17:27:34 -0400
I suppose one important caution about reusable code and libraries is not
to touch code you don't completely understand!

I've repaired the mismatch function to use the hex characters in the
replacement patterns.

I also studied a bit more on regular expressions to better understand
what's going on.  I have a handle on that, now.

Anyway, all of this was a useful learning process.  I would never have
guessed using regular expressions to achieve this result.

Thanks again,
Mike Cook


> > I suppose the use of the ')' in the function could be replaced by a
> > character not occurring in the text data.
>
> no that is inserting regexp grouping syntax, not just a placeholder
character.
>
> > Since we're also processing just ASCII text, and not Unicode, I
replaced
> > the hex codes in the translation with just a space for each special
> > character.
>
> That won't work you need to use a different character for each
> regexp-special character (any characters not in the data would do, but
> they need to be distinct, otherwise you will find that a string of
> "++++" is considered equal to a string "[[[[" as you have made them
both
> a string of spaces before starting the comparison.
>
> David


This email and any attachments are only for use by the intended recipient(s)
and may contain legally privileged, confidential, proprietary or otherwise
private information.  Any unauthorized use, reproduction, dissemination,
distribution or other disclosure of the contents of this e-mail or its
attachments is strictly prohibited.  If you have received this email in error,
please notify the sender immediately and delete the original.

Current Thread