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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:57:51+00:00 2026-05-26T01:57:51+00:00

Here is the input I am searching: \u003cspan class=\prs\>email_address@me.com\u003c\/span> Trying to just return email_address@me.com.

  • 0

Here is the input I am searching:

\u003cspan class=\"prs\">email_address@me.com\u003c\/span>

Trying to just return email_address@me.com.

My regex class=\\"prs\\">(.*?)\\ returns "class=\"prs\">email_address@me.com\" in RegExp which is OK, I can work with that result.

But I can’t get it to work in PHP.

$regex = "/class=\\\"prs\\\">(.*?)\\/";

Gives me an error “No ending delimiter”

Can someone please help?

  • 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-26T01:57:52+00:00Added an answer on May 26, 2026 at 1:57 am

    Your original code:

    $regex = "/class=\\\"prs\\\">(.*?)\\/";
    

    The reason you get No ending delimiter is that although you are escaping the backslash prior to the closing forward slash, what you have done is escaped it in the context of the PHP string, not in the context of the regex engine.

    So the PHP string escaping mechanism does its thing, and by the time the regex engine gets it, it will look like this:

    /class=\"prs\">(.*?)\/
    

    This means that the regular expression engine will see the backslash at the end of the expression as escaping the forward slash that you are intending to use to close the expression.

    The usual PHP solution to this kind of thing is to switch to using single-quoted string instead of a double-quoted one, but this still won’t work, as \\ is an escaped backslash in both single and double quoted strings.

    What you need to do is double up the number of backslash characters at the end of your string, so your code needs to look like this:

    $regex = "/class=\\\"prs\\\">(.*?)\\\\/";
    

    The way to prove what it’s doing is to print the contents of the $regex variable, so you can see what the string will look like to the regex engine. These kinds of errors are actually very hard to spot, but looking at the actual content of the string will help you spot them.

    Hope that helps.

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

Sidebar

Related Questions

Here is the input form code <tr valign=top> <td align=right class=innertablestyle><font class=normal><strong>Homepage</strong></font></td> <td>&nbsp;</td> <td>
here is the input i am getting from my flash file process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1 and in
I'm searching for state abbreviations in a string. Here's an example input string: String
I have a view that dynamically updates depending on user input - here's how
Here is the input (html, not xml): ... html content ... <tag1> content for
GNU sed version 4.1.5 seems to fail with International chars. Here is my input
Here is my jquery code: $('input').click(function(){ $('h1').empty().queue(function(){ console.log('queue'); }); }); }); Only the first
Here are a few possibilities to get the conversation started: Escape all input upon
here is link to an example: http://techchorus.net/demos/jquery/hiding-input-elements-in-a-div.html It actally disables few elements on click
Here is an example of what I'd expect: Input: a { background: red; }

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.