0

*before

product/product_detail/223htc-4083adb/
product/product_detail/224ms-4090/
product/product_detail/225sony-408/

*after

223htc-4083adb
224ms-4090
225sony-408

I want delete all of text before the "detail/" so the unnecessary text like "product/product_detail/" will be gone. How can I do it?

Dharman
  • 30,962
  • 25
  • 85
  • 135
changjx
  • 353
  • 2
  • 8
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/a/2759417/3832970) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Nov 22 '19 at 11:37
  • Find: `^.*?detail/([^/]+)/` ; Replace: `$1` – Toto Nov 22 '19 at 12:33
  • Only `^.*detail|/` was enough. why would you capture it and then reference it back? – Haji Rahmatullah Jun 17 '21 at 04:44
  • @HajiRahmatullah See the rightmost forward-slash on the input text and look at the desired output. The wording in the question omits any mention of removing that character, but Toto's regex removes it. – AdrianHHH Jun 14 '23 at 10:47

0 Answers0