I am in need to find out all strings that match like below pattern
Must start with Letter D
Next 5 chars should be digits only
Next can be 0 to 3 digit or _
Next it can be followed by anything
So then following patterns are correct:
D12345xxxxxxxx
D12345_xxxxxxxx
D123451_xxxxxxxx
D1234512_xxxxxxxx
D1234513_xxxxxxxx
D1234513xxxxxxxx
All other pattern other than above are incorrect. I tried below regexp:
/pd{5,8}[_]?[^a-zA-Z]/gm
But it selects the below values also:
D1234567890_data
D04062_3445
D123456789_val
D04062_343
What regexp I should use so that only words with matching criteria can be extracted?