regexsplit not returning attribute

Peter Schober peter.schober at univie.ac.at
Wed Nov 30 19:59:21 EST 2016


* Cantor, Scott <cantor.2 at osu.edu> [2016-11-30 22:41]:
> On 11/30/16, 4:31 PM, "users on behalf of Lipscomb, Gary" <users-bounces at shibboleth.net on behalf of glipscomb at csu.edu.au> wrote:
> 
> >    The 2 online testers both claim to test java    
> >    Attribute value:   urn:mace:terena.org:schac:personalUniqueID:au:csuid:123456
> >    Regex    [^:]+[^:]*$        and       [^:]+$
> 
> That plugin returns the first matching group. I don't think either of those expressions contains a matching group (I think those have to be parenthesized).
> 
> It seems like that's an awfully over-engineered expression. If all you want is the last segment after a fixed prefix, couldn't you just include the prefix literally?
> 
> ^urn:mace:terena.org:schac:personalUniqueID:au:csuid:(.+)$

Do note that is still using a deprecated namespace (all SCHAC values
and names have been moved from urn:mace:terena.org: to urn:schac: with
the release of the SCHAC RFC years ago), so the more generic regex is
still preferrable, IMO.
[^:]+$ is also what I initially thought I'd use, so a working version
would likely be more like ^.*([^:]+)$ (untested with the IDP) which
doesn't look over-engineerd to me.
Regexes still are a write-only technique for me, though.
-peter


More information about the users mailing list