AnsweredAssumed Answered

How To Use RegEx to Decode VIN

Question asked by clrogers on Jan 27, 2017
Latest reply on Feb 9, 2017 by clrogers

I'm looking to see if there's any information about using a Regular Expression in Survey123 to decode a Vehicle Identification Number (17 Character String) to extract Year, Make, and Model from the VIN String into other fields name as such.

 

I'm fairly certain it can be done but with regards to using Functions within Survey123 the data is fairly vague and not specific enough to know if a RegEx can be used to parse a string as well as force input formatting.

 

Here's a string that is supposed to decode/parse a VIN but I can't seem to find the proper place to use it in Survey123 to even try it out... suspecting that it would have to be placed in the Calculations area but not sure.

 

/^(?:([A-HJ-NPR-Z]){3}|\d{3})(?1){2}\d{2}(?:(?1)|\d)(?:\d|X)(?:(?1)+\d+|\d+(?1)+)\d{6}$/i

Outcomes