I have a string like below
**102-Gracecroft-Dr_Havre-de-Grace_MD_21078_M60846-99581**
I want to remove the last part which starts with M and digits which will be dynamic values. So the result string should be like
"**102-Gracecroft-Dr_Havre-de-Grace_MD**"
How can i achieve it using regex.
i tried with [/.*(?=[/d+]_M[\d-]+)/]
But it is not working. Any ideas?
_Mand the "dynamic values" contains a-in addition to digits.