<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 1/29/16 6:43 AM, Rod Widdowson
wrote:<br>
</div>
<blockquote
cite="mid:00ed01d15a8a$59880c50$0c9824f0$@steadingsoftware.com"
type="cite">
<pre wrap="">... and you’ve tried the extra (regex="(\\d{5})").
Apart from that, pass, someone the other side of the pond should be able to
help.
</pre>
</blockquote>
<br>
<br>
Try one of these, works for me:<br>
<br>
^(\d{5}).*$<br>
<br>
^(\\d{5}).*$<br>
<blockquote
cite="mid:00ed01d15a8a$59880c50$0c9824f0$@steadingsoftware.com"
type="cite">
</blockquote>
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>public class RegExTest {</tt><tt><br>
</tt><tt><br>
</tt><tt> public static void main(String[] args) {</tt><tt><br>
</tt><tt> String target = "12345 some text 12/01/17";</tt><tt><br>
</tt><tt> String patternInput = "^(\\d{5}).*$";</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> Pattern pattern = Pattern.compile(patternInput);</tt><tt><br>
</tt><tt> Matcher matcher = pattern.matcher(target);</tt><tt><br>
</tt><tt> if (matcher.matches()) {</tt><tt><br>
</tt><tt> System.out.println("SUCCESS: matched!");</tt><tt><br>
</tt><tt> System.out.println("Saw group 1: " +
matcher.group(1));</tt><tt><br>
</tt><tt> } else {</tt><tt><br>
</tt><tt> System.out.println("FAIL: Didn't match!");</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt>}</tt><br>
<br>
<br>
In that code, without the anchors, the pattern doesn't even "match"
the target string.<br>
<br>
<br>
<blockquote type="cite">
<pre wrap="">I detest regexps and always have.....</pre>
</blockquote>
<br>
That's because regexps exist in the realm of the Dark Arts, and we
prefer to live in the light... <br>
<br>
<br>
</body>
</html>