I have a string that is "FA4.6.0.J7_13443_DATA" and want to parse through boost::regex
.
These are some following use-cases are to be take care of:
- If first two digit is not "FA" then match failed.
- After "FA" string always be a numeric value only.
- Matching string only "FA4.6.0", After this extra string have no matching (Means anything will be accepted).
- In dotted value there is Max two digit alpha-numeric string only (e.g FA14.66.0, FA4.6a.0, FA4.a6.0, FA4.4.0) and atleast one digit which be always numeric only(e.g. FA4.6.0). if string is "FA4.a.0" then throw an error or not match
Expected Result:
first_data = 4, second_data = 6, third_data = 0
It would be helpful if someone guide me for this problem.