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. General Programming
  3. C#
  4. Html stripping regex

Html stripping regex

Scheduled Pinned Locked Moved C#
regexhtmlquestion
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.
  • O Offline
    O Offline
    OmegaSupreme
    wrote on last edited by
    #1

    I'm trying to write a regular expression which seems easy enough but is elusive. I need to strip some info from a html table. The pattern is simple : 1,2 * [b] tag followed by { anything } followed by optional [em] followed by { anything } followed by 1 or more [span] This is what I've got so far :

    (?:
    [b]
    (?.*?)
    [/b]
    )+
    (?:.|\s)*?
    (?:
    [em](?.*?)[/em]
    )

    Which seems to work fine until I make the '[em]' group 'zero or more' * . That part is then just ignored. :sigh:

    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