I've tried to do the following operation with hive regexp_replace without success :
transforming :
/foo1/foo2/foo3-bar1/p-115390-20.html' or '/foo1/foo2/foo3-bar1/p-115390-35.html
into : /foo1/foo2/foo3-bar1/p-115390.html
knowing that I have urls like
/foo1/foo2/foo3-bar1/p-115390.html
which I don't want to be transformed :
/foo1/foo2/foo3-bar1/p-115390.html
stays /foo1/foo2/foo3-bar1/p-115390.html
I tried to use without success :
SELECT regexp_replace('/foo1/foo2/foo3-bar1/p-115390-20.html', 'p\-\d+(\-\d+\).html', '')
Numbers 115390 or 115390-20 can be any number of course.