Forum Discussion
Regex for parsing LDAP attribute string value
I'm trying to pull a specific variable from an LDAP string attribute. The attribute is proxyAddresses, I need the value of "SMTP:" (case sensitive). I'm using the variable assign option in the VPE. Here is the crappy expression I'm using to create the session.custom.sso.smtp session variable.
session.custom.sso.smtp = expr { [lindex [split [mcget {session.ad.last.attr.proxyAddresses}] "SMTP:"] 1] }
I'm only getting 3 character of the attribute. Here is a sample of the proxyAddress attribute contents;
| sip:ROCKKI@rockservices.com | smtp:ROCKKI@rockservices.appacheonline.com | smtp:Kid_Rock@rockservices.com | smtp:Kid.Rock@rockservices.com | SMTP:ROCKKI@rockservices.com |
Thx
1 Reply
- Stanislas_Piro2
Cumulonimbus
Hi,
in APM variable,
character is the list delimiter....|you can try the following expression:
foreach address [mcget {session.ad.last.attr.proxyAddresses}] { if { [scan $address {SMTP:%s} mail] } { return $mail } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com