I’m having a hard time writing a regular expression for mileage. Mileage can take in any of the following form:
- 130,000 miles
- 130000 miles
- 130XXX miles
- 130,XXX miles
- 130k miles
- something else you can think off
For regex strategy, would be better to read miles first and then take the first word that precedes it. So miles would be read first and then maybe 130,XXX.
use this regex
^\d+,?(\d|X|k)+\smiles$