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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:42:52+00:00 2026-06-02T10:42:52+00:00

I am needing a bit of assistance in a regular expression I am trying

  • 0

I am needing a bit of assistance in a regular expression I am trying to create, I am usually pretty good with these but this one has me stuck…

I am needing to replace the number 9 in strings on the fly with \d (creating a new regular expression). These are some example strings that can be expected:

X(29)

9(5)

99

X(29)V999S

Now before you answer too quickly, we must not touch the numbers in the brackets…
I have looked at a couple of other answers on here and there is probably something in this solution, but I cannot seem to adapt it – Regex for splitting a string using space when not surrounded by single or double quotes

So far I have come up with

line.replaceAll("[^(\\d)]??9[^)]??", "\\d");

which gives me

X(2\d)

\d(5)

\d\d

X(2\d)V\d\d\dS

Anyone have any thoughts.

  • 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-02T10:42:57+00:00Added an answer on June 2, 2026 at 10:42 am

    What about this?

    (?!\([^\(]*)9(?![^\(]*\))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm needing to make this layout editor that uses a good bit of jQuery
I've been at this for a bit now. Basically, I'm needing to add a
Hi guys needing a bit of help. I am creating a one page personal
This is a bit hard to explain in words ... I'm trying to calculate
Having a bit of a brain fart right now, but I'm needing help converting
I'm just needing a simple bit of code for vb.net that will allow me
I am needing to override the notion of inherited z-indexes. For instance in this
I am needing to create a web service, so the first thing I did
I'm needing to create a zip file containing documents that exist on the server.
So I've found myself needing to do a little bit of flash... I'm playing

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.