0

I need help in removing the last string in breadcrumb using regex.

Breadcrumb examples

Home > category > subcategory1 > subcategory2 > subcategory3 > itemname<br>
Home > category > subcategory1 > subcategory2 > itemname

Output should be

Home > category > subcategory1 > subcategory2 > subcategory3<br>
Home > category > subcategory1 > subcategory2

Any help is highly appreciated.

hwnd
  • 69,796
  • 4
  • 95
  • 132
user1761173
  • 59
  • 1
  • 4
  • This appears to be arbitrary HTML and, as such, is a fine candidate for using XML parsing to solve your problem. [Read](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags) and learn. – Shawn Mehan Sep 29 '15 at 03:40
  • So, what have you tried? You should know SO is not a coding service – Mariano Sep 29 '15 at 05:06

0 Answers0