Regex Group Match help
Clash 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.
regular-expression
add a comment |Â
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.
regular-expression
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
add a comment |Â
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.
regular-expression
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
regular-expression
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
add a comment |Â
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
add a comment |Â
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
Note that that operator comes fromperl
â Stéphane Chazelas
Aug 8 at 16:15
add a comment |Â
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
Note that that operator comes fromperl
â Stéphane Chazelas
Aug 8 at 16:15
add a comment |Â
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
Note that that operator comes fromperl
â Stéphane Chazelas
Aug 8 at 16:15
add a comment |Â
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
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
edited Aug 8 at 15:20
answered Aug 8 at 14:49
Mehmet
31613
31613
Note that that operator comes fromperl
â Stéphane Chazelas
Aug 8 at 16:15
add a comment |Â
Note that that operator comes fromperl
â 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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