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

  • Home
  • SEARCH
  • 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 9173313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:33:37+00:00 2026-06-17T16:33:37+00:00

I am learning regex (with this site ) and trying to figure out how

  • 0

I am learning regex (with this site) and trying to figure out how to parse the following string 1***2 to give me [1,2] (without using a specific case for 3 asterisk). There can be any number of asterisks that I need to split as one delimiter, so I am looking for the * char followed by the * wildcard. The delimiters could be letters as well.

The output should only only be numbers so I use ^-^0-9 to split by everything else.

So far I have tried:

input.split("[^-^0-9]"); // Gives me [1, , ,2]

input.split("[^-^0-9\\**]"); // Gives me [1***2]

input.split("[^-^0-9+\\**]"); // Gives me [1***2]

\* does not work as it is not recognized as a valid escape character.

Thanks!

  • 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-17T16:33:38+00:00Added an answer on June 17, 2026 at 4:33 pm

    You are looking for

    input.split("[*]+");
    

    This splits the string on one or more consecutive asterisks.

    To allow other characters (e.g. letters) within delimiters, add them to the [*] character class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning regex ( http://www.regular-expressions.info/ ), and trying to figure out how to
I'm learning RegEx and site crawling, and have the following question which, if answered,
Good afternoon, I'm learning about using RegEx's in Ruby, and have hit a point
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
I am currently learning regex but need this quite urgently. I have a set
As an exercise in learning RegEx in JavaScript, I've been trying to select an
I am using C# and jQuery to valid a username with Regex. Just learning
I have been using this regular expression to extract file names out of file
I'm trying to parse a user input string for duration (into seconds) with Javascript.
I'm having a tough time learning regex and preg_split . I'm trying to apply

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.