Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Vb.net regex finding a pattern after 5 spaces and 2 characters

I am trying to work on this regex pattern and match below examples. There are 5 spaces after Rx which I have tried to use " *", for but no luck.

("RX," *",\w\w(\w\w\w\w))

1)     18468.0  Rx     1CEBF900  8  02 00 00 80 00 01 01 FF - ' should match EBF9 
2)     18468.6  Rx     18FD4000  8  FF FF 00 FF FF FF FF FF - 'should match FD40
ETC . . .

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Here is a pattern that seems to extract the specific data you’re seeking. It was generated and tested via RegExr.

Search Pattern: /(Rx {5}[0-9A-F]{2})([0-9A-F]{4})/g;
List/Replace Pattern: $2

Description: the first capture group specifies "Rx", five spaces, and two hexadecimal range characters; the second capture group specifies the next four hexadecimal range characters.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading