gcue Posted September 2, 2011 Posted September 2, 2011 I am trying to pull 812465E5:0506330 and UNVL_SLO_S09 from this string: <NDL> <REPLICA 812465E5:0506330> <HINT>CN=UNVL_SLO_S09/O=SHUZ</HINT> </NDL>Here's what I have so far: $server = StringRegExp($string, '<HINT>CN=I[\w]+/O=SHUZ</HINT>',2) $replica = StringRegExp($string, '<HINT>CN=I[\w]+/O=SHUZ</HINT>',2) it just returns the whole line.. i think i know why - because what im doing is just redefining the line, how do I use Regexp to give me the characters in between and NOT the ones i specify? thanks in advance!
MrMitchell Posted September 2, 2011 Posted September 2, 2011 These might be backwards... $string = "<NDL>" & _ "<REPLICA 812465E5:0506330>" & _ "<HINT>CN=UNVL_SLO_S09/O=SHUZ</HINT>" & _ "</NDL>" $server = StringRegExp($string, "<REPLICA ([\w\d]*:[\w\d]*)>", 3) $replica = StringRegExp($string, "<HINT>CN=([\w\d_]*)/O=SHUZ</HINT>", 3) MsgBox(0, "", "$server[0] = " & $server[0] & @CRLF & "$replica[0] = " & $replica[0])
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now