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.