xsl-list
[Top] [All Lists]

Re: [xsl] Quoting meta characters for a regular expression character class

2008-08-26 09:18:41
On Tue, Aug 26, 2008 at 5:33 AM, Florent Georges 
<lists(_at_)fgeorges(_dot_)org> wrote:
Dimitre Novatchev wrote:

 Hi Dimitre,

Try whether
http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html
does what you want.

Or simply use a more generally applicable function -- the
f:str-dropWhile() function of FXSL like this:

 At first glance, it seems that your example cuts the largest
substring at the end of the string, that is exclusively compound by
some characters in a list.

Yes. This is exactly the task that the OP wants to carry out. To quote:

"Basically the template accepts a string and a list of characters to
remove from the end of the string"


How is this related to escaping a string
regarding regexes?  It seems I missed something.

The relation is obvious: with this solution one does not need to
evaluate a RegEx at all.



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--