I need to validate a semi-colon separated string:
Example:
;XYZ;2;200;event18=2.5;eVar12=Sale
- The opening semi-colon must be present.
- The 'XYZ' section is mandatory and can be any word or whitespace characters of any length.
- The '2' element is mandatory and must be numeric of unknown length.
- The '200' section is mandatory and must be numeric of unknown length.
- The 'event18=2.5' is optional. If present, the event number will always be a 1 or 2 digit number, and after the = sign will be a number of unknown length and might contain a decimal point.
- The 'eVar12=Sale' is optional. If present, the eVar number will always be a 1 or 2 digit number, and after the = sign will be any combination of word characters and white-space.
I've been banging away at this for a few hours now, but I'm quite the regex newb and I suspect the answer is fairly complex? Any help would be greatly appreciated.