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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:11:55+00:00 2026-05-26T17:11:55+00:00

I am new to regular expressions and need some help. How can I turn

  • 0

I am new to regular expressions and need some help.

How can I turn

string : 7+(4x+2)(3*5)^5
into : 7+(#+#)(3*5)^5

using regular expressions. Is it possible?

basically replace 0-9a-z of string with ( opening 0-9a-z + 0-9a-z ) closing

EDIT

other examples:

string : 3(3+5)^4+8(0+2)
into : 3(#+#)^4+8(#+#)

string : (4+6)
into : (#+#)

string : (4+6)(4+6)
into : (#+#)(#+#)

  • 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-26T17:11:56+00:00Added an answer on May 26, 2026 at 5:11 pm

    Try this

    (?<=\()\d+[a-z]?\+\d+[a-z]?(?=\))
    

    See it here on Regexr

    These two (?<=\() and (?=\)) is a look behind and a look ahead, they ensure, that there is a bracket before and ahead.

    \d+[a-z]? is at least one digit followed by one letter.

    The + is a special character and needs to be escaped, so \+.

    Replace this match with

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

Sidebar

Related Questions

I am very new to regular expressions, and I need some help. First I
I fairly new to regular expressions and need some help. I need to filter
I'm completely incapable of regular expressions, and so I need some help with a
I am new to regular expressions. I am looking for something that can help
I'm completely new to regular expressions, and I need to filter all the words
I need help creating a regular expression for redirecting my old URL's to new
im new to regular expressions in php. I have some data in which some
I'm pretty new to regular expressions. I have a requirement to replace spaces in
I'm new to regular expressions and would appreciate your help. I'm trying to put
I need to port some simple eregi regular expressions to preg_match for PHP 5.3/6.0

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.