| Subject: Re: [xsl] Regular expression to exclude files From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 16 Feb 2023 20:48:25 -0000 | 
Not going to do that.
With the collection() function I can use a predicate to filter the resulting
metadata maps:
let $family := 'utah',
$collectionUri := environment-variable('HOME') || '/git/' ||
$family || '/doc/source' || '?metadata=yes' ||
'&match=' || encode-for-uri('.+\.ditamap'),
$mapFiles := collection($collectionUri)[not(matches((tokenize(.?name,
'/')[last()]), '^(bundle-|publication_|now-|itsa-|_|qa-).+'))],
$pairs := $mapFiles?name ! tokenize(., '/')[last()] ! concat(., ':', .)
return $pairs => sort() => string-join(';')
And that seems to work OK.
I was just curious if I could do it with a single (simple) regex in XPath.
Cheers,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>
From: David Carlisle d.p.carlisle@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thursday, February 16, 2023 at 2:43 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Regular expression to exclude files
[External Email]
________________________________
On 16/02/2023 20:30, Eliot Kimber
eliot.kimber@xxxxxxxxxxxxxx<mailto:eliot.kimber@xxxxxxxxxxxxxx> wrote:
want to match all files with a given extension except those that start with
foo or bar.
classically that would be
|[^fb]|f[^o]|fo[^o]|b[^a]||ba[^r]).*\.txt
David
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/2739265> (by
email)
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3453418> (by
email<>)
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] Regular expression to exc, David Carlisle d.p.c | Thread | [xsl] Re: Regular expression to exc, Chris Papademetrious | 
| [xsl] Re: Regular expression to exc, Chris Papademetrious | Date | [xsl] Re: Regular expression to exc, Eliot Kimber eliot.k | 
| Month |