Jump to content
Sign in to follow this  

trying to parse data using regexp

Recommended Posts


I am trying to pull 812465E5:0506330 and UNVL_SLO_S09 from this string:


<REPLICA 812465E5:0506330>



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!

Share this post

Link to post
Share on other sites

These might be backwards...

$string =  "<NDL>" & _
   "<REPLICA 812465E5:0506330>" & _
$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])

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.