[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    [xsl] [Solution] Need an XPath expression which returns all xs:pattern elements containing a regex t
From:       "Roger L Costello costello () mitre ! org" <xsl-list-service () lists ! mulberrytech ! com>
Date:       2024-04-07 14:57:39
Message-ID: 20240407105937.7fb14ca9 () lists ! mulberrytech ! com
[Download RAW message or body]

Hi Folks,

Here is how to find all xs:pattern elements containing a regex that permits an \
unbounded number of characters:

//xs:pattern[matches(@value, "regex")]

Replace "regex" with this:

^(,[^\}]|\\.|\[(\\.|[^\]\\])*\]|[^*+,\[\\])*([*+]|,\}<file://.|[%5e/%5d/%5d)*/%5d|%5b%5e*+,/%5b/%5d)*(%5b*+%5d|,/%7d>)


Thank you, Michael Sperberg-McQueen!

/Roger
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/651070
or by email: xsl-list-unsub@lists.mulberrytech.com
--~--


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Aptos;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:12.0pt;
	font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#467886;
	text-decoration:underline;}
span.EmailStyle21
	{mso-style-type:personal-reply;
	font-family:"Aptos",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Folks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Here is how to find all \
xs:pattern elements containing a regex that permits an unbounded number of \
characters:<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
style="font-size:14.0pt;color:#787800;background:white;mso-highlight:white">//</span><b><span \
style="font-size:14.0pt;color:#0000E6;background:white;mso-highlight:white">xs:pattern</span></b><b><span \
style="font-size:14.0pt;color:black;background:white;mso-highlight:white">[</span></b><b><i><span \
style="font-size:14.0pt;color:#004000;background:white;mso-highlight:white">matches</span></i></b><b><i><span \
style="font-size:14.0pt;color:black;background:white;mso-highlight:white">(</span></i></b><b><i><span \
style="font-size:14.0pt;color:#F08246;background:white;mso-highlight:white">@value</span></i></b><b><i><span \
style="font-size:14.0pt;color:#787800;background:white;mso-highlight:white">,</span></i></b><b><i><span \
style="font-size:14.0pt;color:black;background:white;mso-highlight:white"> \
</span></i></b><b><i><span \
style="font-size:14.0pt;color:#323296;background:white;mso-highlight:white">&quot;regex&quot;</span></i></b><b><i><span \
style="font-size:14.0pt;color:black;background:white;mso-highlight:white">)]</span></i></b><span \
style="font-size:14.0pt"><o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt">Replace </span><b><i><span \
style="font-size:14.0pt;color:#323296;background:white;mso-highlight:white">&quot;regex&quot;</span></i></b><span \
style="font-size:11.0pt"> with this:<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><b><span \
style="font-size:14.0pt;color:black">^(</span></b><span \
style="font-size:14.0pt;color:black;background:fuchsia;mso-highlight:fuchsia">,[^\}]</span><b><span \
style="font-size:14.0pt;color:black">|</span></b><span \
style="font-size:14.0pt;color:black;background:aqua;mso-highlight:aqua">\\.</span><b><span \
style="font-size:14.0pt;color:black">|</span></b><span \
style="font-size:14.0pt;color:black;background:red;mso-highlight:red">\[(<a \
href="file://.|[%5e/%5d/%5d)*/%5d|%5b%5e*+,/%5b/%5d)*(%5b*+%5d|,/%7d">\\.|[^\]\\])*\]<b><span \
style="background:windowtext;mso-highlight:windowtext">|</span></b><span \
style="background:gray;mso-highlight:gray">[^*+,\[\\]</span><b><span \
style="background:windowtext;mso-highlight:windowtext">)*</span></b><span \
style="background:silver;mso-highlight:silver">([*+]|,\}</span></a></span><span \
style="font-size:14.0pt;color:black;background:silver;mso-highlight:silver">)</span><span \
style="font-size:14.0pt;color:black"><o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:14.0pt;color:black"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span style="font-size:14.0pt;color:black">Thank you, Michael \
Sperberg-McQueen!<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:14.0pt;color:black"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span style="font-size:14.0pt;color:black">/Roger</span><span \
style="font-size:14.0pt"><o:p></o:p></span></p> </div>
</body>
</html>
<div><!-- begin bl.html.trailer -->
<div style="border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href="http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style="text-align:center;">
<a style="color: blue;"
  href="http://lists.mulberrytech.com/unsub/xsl-list/651070"
> EasyUnsubscribe</a>
(<a style="color: blue;"
href="mailto:xsl-list-unsub@lists.mulberrytech.com?subject=remove"
> by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic