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. HELP!! Regular Expression

HELP!! Regular Expression

Scheduled Pinned Locked Moved C#
questionhtmlregexhelp
3 Posts 2 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.
  • B Offline
    B Offline
    brunoconde
    wrote on last edited by
    #1

    Greetings!! I need to get some text from paragraphs on html pages and i did the next regular expression: <\s*p[^>]*>(?<1>[\s\S]*)<\s*/\s*p\s*> where <1> is the group in witch i store all text inside a paragraph. It works fine on one paragraph. If i have this sample:

    hello 1

    hello 2

    hello 3

    i only get one paragraph that is: hello 1

    hello 2

    hello 3 What is wrong???? please help me. thanks. Bruno Conde.

    G 1 Reply Last reply
    0
    • B brunoconde

      Greetings!! I need to get some text from paragraphs on html pages and i did the next regular expression: <\s*p[^>]*>(?<1>[\s\S]*)<\s*/\s*p\s*> where <1> is the group in witch i store all text inside a paragraph. It works fine on one paragraph. If i have this sample:

      hello 1

      hello 2

      hello 3

      i only get one paragraph that is: hello 1

      hello 2

      hello 3 What is wrong???? please help me. thanks. Bruno Conde.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      It's nothing wrong. The pattern you have made is supposed to work that way. Make the pattern that mathes the text non-gready by adding a question mark: [\s\S]*? --- b { font-weight: normal; }

      B 1 Reply Last reply
      0
      • G Guffa

        It's nothing wrong. The pattern you have made is supposed to work that way. Make the pattern that mathes the text non-gready by adding a question mark: [\s\S]*? --- b { font-weight: normal; }

        B Offline
        B Offline
        brunoconde
        wrote on last edited by
        #3

        Thank you very much for your reply... It was realy that. ;):-D pharaoh

        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