Regex and Multiline HTML

Discussion in 'PHP' started by blueparukia, Jun 14, 2008.

  1. #1
    I wanna run a regex similar to this:

    
    <tr>
        <td>
            <b>B([eo])ast</b>
    </td>
       </tr>
    
    Code (markup):
    I want that to be my actual regex pattern - meaning I want to match that string in any HTML file. The tabs and spaces are not exact, but that string, containing boast or beast is on every page - and I want to run this on at least 10 HTML files.

    No idea how to get the multiline, the HTML and the whitespace together,

    Cheers,

    BP
     
    blueparukia, Jun 14, 2008 IP
  2. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try something like "<tr>\s+<td>\s+<b>B[eo]ast</b>\s+</td>\s+</tr>"

    Should work..
     
    zerxer, Jun 14, 2008 IP
  3. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #3
    Righteo, thanks. I'll try later :D
     
    blueparukia, Jun 14, 2008 IP