regexp trhouble

Discussion in 'PHP' started by mauricioprado00, Jun 6, 2009.

  1. #1
    ive some kind of basic trhouble, ive assemble a very long regexp and this is the only part missing to finish it.
    how can i make a regexp that matchs a text with a lot of spaces and in the end something that dont be the text "</b>".
    here is an example:
    
    header('content-type: text/plain;');
    $texto = <<< el_texto
              </b>
    el_texto;
    ;
    
    $regexp = '((\s(?=\s*(?!</b>))))';
    
    preg_match_all($regexp,$texto,$matches);
    var_dump($matches);
    
    Code (markup):
    that code actually return results even when i dont need it, i need to a regular expresion that return te spaces only when is not followed by </b>, or dont return nothing if its pressent.
     
    mauricioprado00, Jun 6, 2009 IP
  2. Multiplexor

    Multiplexor Greenhorn

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Get the tool from regexbuddy.com - it will solve all your problems!
     
    Multiplexor, Jun 7, 2009 IP