How to write regex expression to remove particualr string

Hi,

How to write regex expression for below string to get the final output as

"d1a2227e-291f-4d82-8991-b9458b4ad0d3","fb48e632-3c85-483b-86b3-76f7a1c7eb25","93fa5301-29e2-4ef6-9353-686868686888"



input string= @Check:"workspace://SpacesStore/d1a2227e-291f-4d82-8991-b9458b4ad0d3" OR @Check:"workspace://SpacesStore/fb48e632-3c85-483b-86b3-76f7a1c7eb25" OR @Check:"workspace://SpacesStore/93fa5301-29e2-4ef6-9353-686868686888
chaituu chaituAsked:
Who is Participating?
 
CEHJCommented:
It's just capturing the characters of those IDs only. More precise would be

        Pattern p = Pattern.compile("((?:[a-f0-9]+-){4}[a-f0-9]+)");
        Matcher m = p.matcher(s);
        while (m.find()) {
            System.out.println(m.group());
        }

Open in new window

0
 
Rgonzo1971Commented:
HI,

pls try
workspace:\/\/SpacesStore\/

Open in new window

REgards
0
 
CEHJCommented:
That's ONE input string?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
chaituu chaituAuthor Commented:
That's ONE input string?

yes
0
 
CEHJCommented:
You might try something like this (where input string is 's')

        Pattern p = Pattern.compile("/([a-f0-9\\-]+)\"");
        Matcher m = p.matcher(s);
        while (m.find()) {
            System.out.println(m.group(1));
        }

Open in new window

0
 
chaituu chaituAuthor Commented:
its working.May i know the meaning of this expression?
0
 
chaituu chaituAuthor Commented:
what is the meaning of this ?:[a-f0-9]+-){4}  ???
0
 
CEHJCommented:
Capture groups of lower case hex characters separated by hyphens
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
See the explanation section on the right-hand side of
https://regex101.com/r/L5FxH4/1
0
 
CEHJCommented:
Sorry - let me be a little more precise:
Capture groups of lower case hex characters followed by hyphens four times (the remainder of pattern is explained by the first seven words [only] of this sentence)
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.