Wasim A. Wasim A. - 1 year ago 92
Javascript Question

Regular Expression Match to Extract Command




Required Output:
[Z123od33; Z123od343; Z251od541;]

But Current Output :
[Z123xy;Z123od33; Z123od343; Z251od541;]

enter image description here

I know why its happening that way but don't know how to solve this. Any one could help please

Jan Jan
Answer Source

You could go for

# require a Z
# anything not a ; lazily
# od
# anything not a ; lazily again
# followed by a ;

See a demo on regex101.com or split on the ; and analyze the parts later separately.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download