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 6845199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:28:16+00:00 2026-05-27T00:28:16+00:00

Consider a variable length string starting with a variable number of digits, then a

  • 0

Consider a variable length string starting with a variable number of digits, then a non-digit, then anything.

Eg. 283432478($#*a433sd

(ignore SO’s coloring)

Here I would like to extract the digit part 283432478. No big deal.

However sometimes this string is very large and a portion in the middle has been manually and haphazardly replaced by ...

Eg. 23445678404325jkla#$s23k$#$     =>     2344567840...3k$#$

By haphazardly I mean it could happen anywhere within the string, nor does it result in a fixed length string.

I would like the same regular expression to fail matching if it sees a ....

Any suggestions?

  • 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-05-27T00:28:16+00:00Added an answer on May 27, 2026 at 12:28 am

    You can try:

    ^([0-9]+)(?!.*\.\.\.)
    

    See it

    ^            - Start anchor
    ([0-9]+)     - Capture one more digits
    (?!.*\.\.\.) - Negative lookahead to ensure a ... is not present. Since . is a 
                   regex meta-char, you need to escape it to mean a literal period.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following html: <div class=image> <img src=sample.png/> <div class=text> Text of variable length
Consider I have a variable class_name . class_name can hold string values like blog
Consider an ASP.NET MVC application that requires a session variable be set. It's used
How can I instantiate a class by throwing in a variable name? Consider this
Consider: List<String> someList = new ArrayList<>(); // add "monkey", "donkey", "skeleton key" to someList
Consider variable like var url='http://www.example.com/index.php?id=ss'; or var url='http://www.example.com/dir1/dir2/index.php'; In these variables, i want to
ARC/ObjC++: ObjC objects as C++ member variable Consider class SomeCppClass { NSLock * someLock
Consider a simple (global in my case) variable: int i; Somewhere this variable is
Consider the following public method that adds an integer variable to a vector of
Consider var person=JSON.parse('{name:Alice,id,1234}') . How do I remove a key from the variable person?

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.