I am trying to extract data from a string using Regex in VB.net. This is my string
CN=firstname lastname/OU=orgunit/O=org;shortname
I am basically trying to retrieve
firstname lastname (together)
orgunit
org
shortname
can someo开发者_开发问答ne please help me.
Try this regexp:
^/CN=([^/]*)/OU=([^,]*),O=([^;]*);(.*)$
(first capture group is name, second is orgunit, third is org, fourth is shortname)
精彩评论