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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:40:46+00:00 2026-06-15T11:40:46+00:00

I am using a Regular Expression to perform a find and replace with dreamweaver.

  • 0

I am using a Regular Expression to perform a find and replace with dreamweaver. I am running into some difficulty. This is what I have in my page (note that there is a syntax error because I need an additional parenthesis at the end of the string).

$email=htmlspecialchars(mysql_real_escape_string($_POST['email']);      
$name=htmlspecialchars(mysql_real_escape_string($_POST['name']);    

I am trying to performa a find and replace that will produce this:

$email=htmlspecialchars(mysql_real_escape_string($_POST['email']));                                                    
$name=htmlspecialchars(mysql_real_escape_string($_POST['name']));

This is what I am using to perform the find. It seems to be replacing too much text (it starts with the $_POST from the $email variable, but continues all the way down to the $_POST for the $name variable)

  • Find: \$_POST[‘([^<]*)’]
  • Replace: $_POST[‘$1’])

I end up with this:

$email=htmlspecialchars(mysql_real_escape_string($_POST['email']);      
$name=htmlspecialchars(mysql_real_escape_string($_POST['name']));   

As you can see, it only fixes the last instance (this is because the find function is selecting both lines from $_POST[’email’] all the way to $_POST[‘name’]). Any ideas on how to fix this? Thank you!

  • 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-15T11:40:47+00:00Added an answer on June 15, 2026 at 11:40 am

    Add a question mark to make it non-greedy. Also, you need to escape the [ and ] characters that you want to match.

    Find: \$_POST\['([^<]*?)'\]
    Replace: $_POST['$1'])
    

    Or, alternatively, user a ‘ character instead of a < character to match the value within the quotes:

    Find: \$_POST\['([^']*)'\]
    Replace: $_POST['$1'])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble using regular expression to get date in a string. Example
I want to match D11-RONPLAYER_DEF_15_PO using this regular expression: D\[0-9]+-\[A-Z]*PLAYER_(DEF\[0-9]*)_(\[^_]+)_ but it does not
How do I, using a regular expression , split this string : string =
I'm using a dart regular expression and trying to find a match . Dart
I have to check the string using Regular expression: String a = ABC(hello) or
How Can I forbid repeated characters using regular Expression? This regular Expression should not
Does any one know how to find following string using regular expression of visual
I'm having problems using regular expression to match http links. I have a pattern
I am using regular expression to search for some string fit for my restrictions.
I am using regular expression to check number of digits after decimal. This is

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.