Solved

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

Posted on 2014-02-21
2
275 Views
Last Modified: 2014-02-21
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.
0
Comment
Question by:tolppa
2 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39876597
(.*)\|(\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
 
LVL 1

Author Closing Comment

by:tolppa
ID: 39877302
Perfect.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question