Reqular Expressions: How to find string that match start with |

I want to remove GUID from string. Guid start with | character. I can remove guid using [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}, but how to find results starting wiht |?

Currently Mr Nice |d60205ce-e85e-48d4-8cf5-8ab55ba641dc would be "Mr Nice |" , but I need to remove first "|". Result should be Mr Nice.
LVL 1
tolppaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
(.*)\|(\w*-){4}\w*

Your desired result will be in group 1.

Or, if you only want to delete the GUID, use:
\|(\w*-){4}\w*

HTH,
Dan
0
 
tolppaAuthor Commented:
Perfect.
0
All Courses

From novice to tech pro — start learning today.