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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:50:25+00:00 2026-05-16T21:50:25+00:00

I want to check a string and if it has no <br /> starting

  • 0

I want to check a string and if it has no <br /> starting then I don’t wanna do any thing
for example mysqtinr = 23435-acs
as you can see no <br /> starting
but if the string has the following then I wanna parse it out

myString = <br /> some text goes here <b> Some other things </b>: just more test <b> http://website/index.php </b> on line <b> 43 </b> <br /> 1234-acd

I want to parse out everything after the last <br />

how can I do that
thanks

  • 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-16T21:50:25+00:00Added an answer on May 16, 2026 at 9:50 pm
    var myregexp = /<br\s*\/>((?:(?!<br\s*\/>).)*)$/;
    var match = myregexp.exec(subject);
    if (match != null) {
        result = match[1];
    } else {
        result = "";
    }
    

    Explanation:

    <br\s*/>        # match <br /> with optional space
    (               # capture the following:
     (?:            # repeat the following, but don't capture (because the outer parens do so already)
      (?!<br\s*/>)  # assert that it's impossible to match <br />
      .             # if so, match any character
     )*             # do this as many times as necessary...
    )               # (end of capturing group)
    $               # ...until the end of the string.
    

    So we first try to match <br/> or <br /> etc. If that fails, the match fails. If not, then we capture every following character until the end of the string unless it’s possible to match another <br/> along the way. This ensures that we are indeed matching from the last <br/> onwards. The result will be in backreference nr. 1 (which may be empty if there is nothing after the last <br/>).

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

Sidebar

Related Questions

I want something that can check if a string is SELECT , INSERT ,
I want to check if a string object of 20 characters has only null
I have the string $str and I want to check if it`s content has
I want to I check whether a string is in ASCII or not. I
If I want to check for the null string I would do [ -z
I want to do preliminary check if entered string looks like Vehicle Identification Number
I want to split a string using a delimiter, for example split "004-034556" into
I have a string and I want to check if the content is in
I want to filter some string which has some wrong letters (non- ASCII ).
I have a string var s1 = a,$,b,c; I want to check if another

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.