Regex Group Match help

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Using this regex ;(31055d*)|^;d10(d7) How do I get the second part of the regex after the "|" to report as Group 1 using the test string of ;1000000000146691301? The regex is working but I need the ;1000000000144691301? to match to 1446913 in Group 1 not group 2. I need both matches to come out in group 1. The first part of the regex works using ;3105540001042017? and reports in Group 1.










share|improve this question



















  • 1




    Give concrete example what you are trying to achieve, it looks like XY problem.
    – jimmij
    Aug 8 at 14:54










  • Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
    – Stéphane Chazelas
    Aug 8 at 15:57










  • please make your question more clear. however sed is perfect tools to grouping the regex pattern
    – Hossein Vatani
    Aug 8 at 17:14














up vote
0
down vote

favorite












Using this regex ;(31055d*)|^;d10(d7) How do I get the second part of the regex after the "|" to report as Group 1 using the test string of ;1000000000146691301? The regex is working but I need the ;1000000000144691301? to match to 1446913 in Group 1 not group 2. I need both matches to come out in group 1. The first part of the regex works using ;3105540001042017? and reports in Group 1.










share|improve this question



















  • 1




    Give concrete example what you are trying to achieve, it looks like XY problem.
    – jimmij
    Aug 8 at 14:54










  • Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
    – Stéphane Chazelas
    Aug 8 at 15:57










  • please make your question more clear. however sed is perfect tools to grouping the regex pattern
    – Hossein Vatani
    Aug 8 at 17:14












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Using this regex ;(31055d*)|^;d10(d7) How do I get the second part of the regex after the "|" to report as Group 1 using the test string of ;1000000000146691301? The regex is working but I need the ;1000000000144691301? to match to 1446913 in Group 1 not group 2. I need both matches to come out in group 1. The first part of the regex works using ;3105540001042017? and reports in Group 1.










share|improve this question















Using this regex ;(31055d*)|^;d10(d7) How do I get the second part of the regex after the "|" to report as Group 1 using the test string of ;1000000000146691301? The regex is working but I need the ;1000000000144691301? to match to 1446913 in Group 1 not group 2. I need both matches to come out in group 1. The first part of the regex works using ;3105540001042017? and reports in Group 1.







regular-expression






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 8 at 14:49









Mehmet

31613




31613










asked Aug 8 at 14:38









Eric Peterson

1




1







  • 1




    Give concrete example what you are trying to achieve, it looks like XY problem.
    – jimmij
    Aug 8 at 14:54










  • Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
    – Stéphane Chazelas
    Aug 8 at 15:57










  • please make your question more clear. however sed is perfect tools to grouping the regex pattern
    – Hossein Vatani
    Aug 8 at 17:14












  • 1




    Give concrete example what you are trying to achieve, it looks like XY problem.
    – jimmij
    Aug 8 at 14:54










  • Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
    – Stéphane Chazelas
    Aug 8 at 15:57










  • please make your question more clear. however sed is perfect tools to grouping the regex pattern
    – Hossein Vatani
    Aug 8 at 17:14







1




1




Give concrete example what you are trying to achieve, it looks like XY problem.
– jimmij
Aug 8 at 14:54




Give concrete example what you are trying to achieve, it looks like XY problem.
– jimmij
Aug 8 at 14:54












Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
– Stéphane Chazelas
Aug 8 at 15:57




Possible duplicate of sed regexp text processing capture grouping referencing alternation confusion
– Stéphane Chazelas
Aug 8 at 15:57












please make your question more clear. however sed is perfect tools to grouping the regex pattern
– Hossein Vatani
Aug 8 at 17:14




please make your question more clear. however sed is perfect tools to grouping the regex pattern
– Hossein Vatani
Aug 8 at 17:14










1 Answer
1






active

oldest

votes

















up vote
0
down vote













How about (?|;(31055d*)|^;d10(d7))



This requires Branch Reset Group which is not available in JavaScript, so depending on what language you are using, it may not work.



Working example: https://regexr.com/3tlk1






share|improve this answer






















  • Note that that operator comes from perl
    – Stéphane Chazelas
    Aug 8 at 16:15










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461303%2fregex-group-match-help%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













How about (?|;(31055d*)|^;d10(d7))



This requires Branch Reset Group which is not available in JavaScript, so depending on what language you are using, it may not work.



Working example: https://regexr.com/3tlk1






share|improve this answer






















  • Note that that operator comes from perl
    – Stéphane Chazelas
    Aug 8 at 16:15














up vote
0
down vote













How about (?|;(31055d*)|^;d10(d7))



This requires Branch Reset Group which is not available in JavaScript, so depending on what language you are using, it may not work.



Working example: https://regexr.com/3tlk1






share|improve this answer






















  • Note that that operator comes from perl
    – Stéphane Chazelas
    Aug 8 at 16:15












up vote
0
down vote










up vote
0
down vote









How about (?|;(31055d*)|^;d10(d7))



This requires Branch Reset Group which is not available in JavaScript, so depending on what language you are using, it may not work.



Working example: https://regexr.com/3tlk1






share|improve this answer














How about (?|;(31055d*)|^;d10(d7))



This requires Branch Reset Group which is not available in JavaScript, so depending on what language you are using, it may not work.



Working example: https://regexr.com/3tlk1







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 8 at 15:20

























answered Aug 8 at 14:49









Mehmet

31613




31613











  • Note that that operator comes from perl
    – Stéphane Chazelas
    Aug 8 at 16:15
















  • Note that that operator comes from perl
    – Stéphane Chazelas
    Aug 8 at 16:15















Note that that operator comes from perl
– Stéphane Chazelas
Aug 8 at 16:15




Note that that operator comes from perl
– Stéphane Chazelas
Aug 8 at 16:15

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461303%2fregex-group-match-help%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?