Subject: Re: Finding first difference between 2 text strings
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 14 Sep 2009 20:10:40 +0100
|
> 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
________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________
|