<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=us-ascii">
<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@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:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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 bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">OK great advice here. I have a working regex now, but just wondered why mine wasn’t working to start with. I’ll do some more testing
 at this end, but my primary problem is now solved.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks to everyone that replied.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<br>
Andi<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> users [mailto:users-bounces@shibboleth.net]
<b>On Behalf Of </b>Brent Putman<br>
<b>Sent:</b> 29 January 2016 20:14<br>
<b>To:</b> users@shibboleth.net<br>
<b>Subject:</b> Re: RegexSplit resolver returning no values<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 1/29/16 6:43 AM, Rod Widdowson wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>... and you’ve tried the extra (regex="(<a href="file:///\\d%7b5%7d)">\\d{5})</a>").<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Apart from that, pass, someone the other side of the pond should be able to<o:p></o:p></pre>
<pre>help.  <o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
Try one of these, works for me:<br>
<br>
^(\d{5}).*$<br>
<br>
^(<a href="file:///\\d%7b5%7d).*$">\\d{5}).*$</a><br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">For a Java String literal, you definitely need the 2nd one, with backslash escape of the literal backslash, b/c of String literal requirements.  Not sure about here in the IdP, I think you don't need the escaping when the pattern input
 is read in as "data".  So the 1st one might work there.<br>
<br>
The main thing is: I don't know off-hand exactly why it doesn't work without the anchors, but it doesn't. That's usually the first thing I try when a regex doesn't work as I expect:  remove ambiguity and explicitly anchor at both ends.<br>
<br>
Fyi, here's the simple Java scratch code I wrote to test.  Mirrors what the RegexSplit- attribute definition does:<br>
<br>
<tt><span style="font-size:10.0pt">public class RegExTest {</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<tt>    public static void main(String[] args) {</tt><br>
<tt>        String target = "12345 some text 12/01/17";</tt><br>
<tt>        String patternInput = "^(<a href="file:///\\d%7b5%7d).*$">\\d{5}).*$</a>";</tt><br>
<tt>        </tt><br>
<tt>        Pattern pattern  = Pattern.compile(patternInput);</tt><br>
<tt>        Matcher matcher = pattern.matcher(target);</tt><br>
<tt>        if (matcher.matches()) {</tt><br>
<tt>            System.out.println("SUCCESS: matched!");</tt><br>
<tt>            System.out.println("Saw group 1: " + matcher.group(1));</tt><br>
<tt>        } else {</tt><br>
<tt>            System.out.println("FAIL: Didn't match!");</tt><br>
<tt>        }</tt><br>
<tt>    }</tt><br>
<br>
<tt>}</tt></span><br>
<br>
<br>
In that code, without the anchors, the pattern doesn't even "match" the target string.<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I detest regexps and always have.....<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
That's because regexps exist in the realm of the Dark Arts, and we prefer to live in the light...
<br>
<br>
<o:p></o:p></p>
</div>
<hr>
<br>
<a href="http://www.cardiffmet.ac.uk/cardiffmet150" target="_blank"><img src="http://campaigns.cardiffmet.ac.uk/150/email-footer.gif" alt="Cardiff Metropolitan University - 150 years of nurturing talent" width="398" height="108" border="0"></a>
</body>
</html>