Hi, I want to extract a portion of a string that I get from a website. For example the string may contain: “… VIN#: XXXXXXX…”, for my purpose I would need to just extract the actual VIN number, i.e. XXXXXXX. Is there an easy way to do this? If so can you point me in the right direction?
Thank you.
Yes a regex is the correct way to extract the text. To be able to do so we need to know the different variations of the string. Please provide the exact text that you receive and need to extract from.
If the VIN looks like this
VIN#: 2FMDK3KC1BBA56045
You can use this regex
(?<=VIN#: ).*
Thanks Deyan! A typical example is:
SeedNav - D-AUDIO
*VIN#: KNAPU81DMP7118600
*REF#: D8422600221528
I’m new to RegEx so your help would be very much appreciated!
Actually there are some instances where there is a space between VIN# and :
Eg:
SeedNave - D-AUDIO
*VIN# : KNAPU81DMP7118600
*REF# : D8422600221528
Is there an ‘Or’ operator to handle that?
Thanks!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.