Question about regular expressions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Olsen

    #1

    Question about regular expressions

    In parsing a string that contains HTML, I need to return the text
    between each word "characters " and the first "&nbsp" after "characters ".

    There can be any number of these patterns in the page. I believe I would
    use the MatchCollection class. But I'm having difficulty forming the
    RegularExpressi on.

    Thanks for any help.



    *** Sent via Developersdex http://www.developersdex.com ***
  • Wicksy

    #2
    Re: Question about regular expressions

    how about:
    expression = "characters.*&n bsp"

    that's a full stop (period) and an asterisk inbetween the search strings -
    which basically means "anything inbetween characters and &nbsp".


    "Terry Olsen" <tolsen64@hotma il.com> wrote in message
    news:OouFvYDyFH A.2348@TK2MSFTN GP15.phx.gbl...[color=blue]
    > In parsing a string that contains HTML, I need to return the text
    > between each word "characters " and the first "&nbsp" after "characters ".
    >
    > There can be any number of these patterns in the page. I believe I would
    > use the MatchCollection class. But I'm having difficulty forming the
    > RegularExpressi on.
    >
    > Thanks for any help.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***[/color]


    Comment

    • Phill.  W

      #3
      Re: Question about regular expressions

      "Terry Olsen" <tolsen64@hotma il.com> wrote in message
      news:OouFvYDyFH A.2348@TK2MSFTN GP15.phx.gbl...[color=blue]
      > In parsing a string that contains HTML, I need to return the text
      > between each word "characters " and the first "&nbsp" after
      > "characters ".[/color]

      I'm no expert, but I /think/ this should do the trick ...

      "characters(.*) &nbsp"

      HTH,
      Phill W.


      Comment

      Working...