Need help: RegEx for nested TABLEs (I can pay)

Discussion in 'Programming' started by Alfahane, May 25, 2008.

  1. #1
    I'm trying to write a regex that matches tables (html) with or without content and with possible nested tables. I'm working in vbscript

    If I use
    "<table\b[^>]*>(.*?)</table>"

    the following will be matched
    <table>..<table>..</table>
    this will exclude the outer </table> (and any content between the inner and outer </table>)


    I was thinking of matching a table that does not contain a table (string "<table") and then put it in a loop (a simple for ... next in vbscript) but I'm newbeeish in the world of regex to make that work =(
     
    Alfahane, May 25, 2008 IP
  2. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #2
    Try searching for "ungreedy" expressions in VB. I know in PHP, you will have to use a modifier to make it "greedy".

    Peace,
     
    Barti1987, May 27, 2008 IP