Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Reg Ex question.

Reg Ex question.

Scheduled Pinned Locked Moved Web Development
regexquestionhtmltoolstutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theJazzyBrain
    wrote on last edited by
    #1

    Dear CPians, I am trying to make a regular expression to be used in ASP (VB Script). I need to search for a specific TAG within an HTML file. I want the regullar expression to provide me with the TAG as one MATCH and all its attribute names and value pairs in SUBMATCHES. For example if the following TAG existed in an HTML file, my regular expresion should return the tag as it is. <SPAN id="spanId" onclick="doSomething();">my span</SPAN> and then I would like to get the atribute pairs as such: id spanId onclick dosomething So far I have come up with this pattern: <SPAN\s*(((\w+)=(.*?))*)?>(?:.*?)</SPAN> The pattern above would return the tag as it is in the HTML file. then all the attributes together as such: id="spanId" onclick="doSomething();" and then it will return only the last attribute name-value pair. onclick dosomething discarding the first one (id,spanId) Any ideas? theJazzyBrain

    Excellence is not an act, but a habit!

    Aristotle

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups