I need to find an exact match of the number 4 in a comma-separated string.
4,44,24 - expected 4,
44,4,24 - expected 4,
4 - expected 4
The goal is to identify 4 without being confused by similar numbers like 44 and 24.
I attempted to use /\b4,/g
with word boundaries.
4,44,24 - Matches
44,4,24 - Matches
4 - fails
If you have any suggestions, please let me know. Thank you!