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. Regular expression problem

Regular expression problem

Scheduled Pinned Locked Moved C#
questionregexhelptutorial
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.
  • W Offline
    W Offline
    wi5nia
    wrote on last edited by
    #1

    hi, I have a question about RE. Lets say I have this string: Text I get the "Text" by using this RE: MatchCollection m = Regex.Matches(wynik,@"\"">\s*(.+?)\s*"); I use MatchCollection beacuse I do it on a bigger file but for the ease of writing ths post I'm just an example of one line. Then on my collection I do a foreach and each Text is set as an Item Label in a dropDown list. But in the m regex I would also like to get the "comment" so then in my foreach loop I would be also able to assign it to the items Tag lets say. How can I achive this?

    P 1 Reply Last reply
    0
    • W wi5nia

      hi, I have a question about RE. Lets say I have this string: Text I get the "Text" by using this RE: MatchCollection m = Regex.Matches(wynik,@"\"">\s*(.+?)\s*"); I use MatchCollection beacuse I do it on a bigger file but for the ease of writing ths post I'm just an example of one line. Then on my collection I do a foreach and each Text is set as an Item Label in a dropDown list. But in the m regex I would also like to get the "comment" so then in my foreach loop I would be also able to assign it to the items Tag lets say. How can I achive this?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      I recommend using an XmlDocument for working with XML.

      W 1 Reply Last reply
      0
      • P PIEBALDconsult

        I recommend using an XmlDocument for working with XML.

        W Offline
        W Offline
        wi5nia
        wrote on last edited by
        #3

        but it's not a xml document and XmlDocument in that case sometimes doesn't do its job good so thats why I want to use reg. ex.

        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