On Wed, 16 Feb 2005 13:36:12 +0000, "MJ Ray" <mjr@dsl.pipex.com> said:
Richard wrote:
XSLT regex syntax allows: "* X{n}? matches X, exactly n times * X{n,}? matches X, at least n times * X{n,m}? matches X, at least n times, but not more than m times" of which I'm trying to use the second with the replace() function like this: replace($text, '(.{n,}?)\s+', '$1 ')
Why did you change from the third type to the second type when moving from sed to XSLT? Your sed example was equivalent to (.{0,X}?)\s+ wasn't it? Changing type will change the meaning of the regex.
I hadn't noticed that. Um, {,n} and {n,} seem to work in sed, but {,n} causes a runtime error in XSLT saying that it expects a digit and if you use {0,n} it says it doesn't allow a regex that matches a 0 length string (presumably because its the replace() function). ({1,n} just splits it into single word strings...) I'll keep fiddling. Richard