I have some javascript that I need assistance with where I want to update a string with javascript.
Original string:
987654321-200x200-1_This+is+text.jpg
Want it to end up to be:
not_found-200x200.jpg
So 987654321
gets replaced with not_found and -1_This+is+text
with nothing.
Note the original string is fully dynamic with only the - x - _ +
constant in all.
I have tried something like this:
'987654321-200x200-1_This+is+text.jpg'.replace(/\_\d{0,}[A-Za-z]*/, '_not_found')
but need help with the regexp to achieve this. Anyone help?