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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:52:25+00:00 2026-05-18T23:52:25+00:00

I have the following string: <span class=ClassName @variable title=ClassName @variable>Variable Title</span> ClassName, variable &

  • 0

I have the following string:

<span class="ClassName @variable" title="ClassName @variable">Variable Title</span>

“ClassName”, “variable” & “Variable Title” are paramerters.

Now I want to extract the “ClassName”, “variable” and “Variable Title” from that sentence. How can I do that?

  • 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-18T23:52:26+00:00Added an answer on May 18, 2026 at 11:52 pm

    Javascript:

    var matches = /<span class="(.*)" title="(.*)">(.*)<\/span>/.exec(str);
    

    Where str is your tag.

    Then…

    matches[1]=class
    matches[2]=title
    matches[3]=tag content
    

    Note that you should really use a proper HTML parser for this kind of thing rather than Regex but never mind 🙂

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

Sidebar

Related Questions

I have the following long string returned from a SOAP call into a variable,
I have the following string as a variable: var name1 = '001-C6AL7_deepgreen_C3AE7_tankhakinavy_FJAG7_blackredmulti_FBAE7_tanbrown.jpg'; Which is
I have the following string assigned to a variable: $date = 16 June, 2012,
I have the following string in a variable. Stack Overflow is as frictionless and
How can I select the string contents of the following nodes: <span class=url> word
Does anyone have a fix for the following; I'm taking the following string: <span
I have a rest/xml service that gives me the following... <verse-unit unit-id=38009001> <marker class=begin-verse
I have the following Code var page = '<h1>Hello!</h1><p>FOO</p><span class=username>this is ur name</span><p>sample text</p>';
I have the following text on my page: <span class=UTCDate>Date.UTC(2011, 8, 7, 7, 9,
Here's a live demo . I have the following html: <div class=Q> <div id=Q3><span>1.

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.