<html><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: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;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-US;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.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></head><body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word"><div class="WordSection1"><p class="MsoNormal">Thank you Christopher. I will try that.</p><p class="MsoNormal"> </p><p class="MsoNormal">Appreciate it.</p><p class="MsoNormal"> </p><div><p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-GB">Rick </span></p></div><p class="MsoNormal"> </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="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> users <<a href="mailto:users-bounces@shibboleth.net">users-bounces@shibboleth.net</a>> <b>On Behalf Of </b>Christopher Bongaarts via users<br><b>Sent:</b> 29 April 2022 20:12<br><b>To:</b> <a href="mailto:users@shibboleth.net">users@shibboleth.net</a><br><b>Cc:</b> Christopher Bongaarts <<a href="mailto:cab@umn.edu">cab@umn.edu</a>><br><b>Subject:</b> Re: Regex in the SHibboleth2.xml</span></p></div></div><p class="MsoNormal"> </p><div><p class="MsoNormal">On 4/29/2022 2:05 PM, Rick Hoodenpyle wrote:<span style="mso-fareast-language:EN-GB"></span></p></div><blockquote style="margin-top:5.0pt;margin-bottom:5.0pt"><p class="MsoNormal">I often have to separate username from the email address using the following:</p><p class="MsoNormal"> </p><p class="MsoNormal"><!--<AttributeResolver type="Transform" source="upn"></p><p class="MsoNormal">              <Regex match=<a href="mailto:%5e(.+)@(.+)$">"^(.+)@(.+)$"</a> dest="LoginID">$1</Regex></p><p class="MsoNormal">              <Regex match=<a href="mailto:%5e(.+)@(.+)$">"^(.+)@(.+)$"</a> dest="domain">$2</Regex></p><p class="MsoNormal"></AttributeResolver>--></p><p class="MsoNormal"> </p><p class="MsoNormal">I have a client though that passes an ID through the UID attribute. It begins with a letter K and ends with the numerical ID, example K98456.</p><p class="MsoNormal"> </p><p class="MsoNormal">The value that this must equate to in my application is a numerical only value, so I am needing to find out how to remove the K and only pass the numbers. I have thought about maybe using the following, but have not had a chance to test it and was wondering if someone out there might already know how to do this.</p><p class="MsoNormal"> </p><p class="MsoNormal"><!--<AttributeResolver type="Transform" source="uid"></p><p class="MsoNormal">              <Regex match="^(.+)[0-9](.+)$" dest="kuid">$1</Regex></p><p class="MsoNormal"></AttributeResolver>--></p></blockquote><p>Given K followed by numbers, and extracting just the numbers, you would use something like:</p><p><span style="font-family:"Courier New""><Regex match="^K([0-9]+)$" dest="kuid">$1</Regex></span></p><pre>-- </pre><pre>%%  Christopher A. Bongaarts   %%  <a href="mailto:cab@umn.edu">cab@umn.edu</a>          %%</pre><pre>%%  OIT - Identity Management  %%  <a href="http://umn.edu/~cab">http://umn.edu/~cab</a>  %%</pre><pre>%%  University of Minnesota    %%  +1 (612) 625-1809    %%</pre></div></body></html>