Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8895607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:49:27+00:00 2026-06-14T23:49:27+00:00

In the below code, I am trying to split between two numbers. The splitting

  • 0

In the below code, I am trying to split between two numbers. The splitting is not functioning correctly. For eg: when I split between 0 and 1, the split also occurs in between digits of 10 and 11.

Can some one help me in this?

    use strict;
    use warnings;

    my $j= "0,2,3,6,5,1,4,7,8,12,11,10,9";
    my $k=1; my $k1=0,;
    my @ar=split(/($k|$k1)/,$j);

    print join(";",@ar);

    Expected result:0;2,3,6,5;1;4,7,8,12,11,10,9
    Above code result: 0;,2,3,6,5,;1;,4,7,8,;1;2,;1;1;,;1;0;,9
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:49:29+00:00Added an answer on June 14, 2026 at 11:49 pm

    First, you don’t want to split on 0 or 1, you want to split on a commas next to the number 0 or 1.

    split /(?<!\d)(?:0|1)\K,|,(?=(?:0|1)(?!\d))/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to convert the code below to a shorthand linq, but not
I have the below code that i am trying to have two datagrids with
In the below code I'm trying to loop through each child node and append
I'm using the javascript code below trying to extract the number after gallery-entry_ in
In the code below i`m trying to read a list of selected projects and
I have been trying to access the below code DECLARE N_DEPTNO DEPT.DEPTNO %TYPE :=&DEPT_NUM;
In the below code, i am trying to reference an external .dll, which creates
I am trying to change desktop image using below code: NSError *anError = nil;
I found the below code in the Internet, I'm trying to understand how Linux
I'm trying to get from Line #1 to Line #2 in the below code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.