php - regex- preg_replace - space after line-break!

Posted by aSeptik on Stack Overflow See other posts from Stack Overflow or by aSeptik
Published on 2010-05-02T15:21:57Z Indexed on 2010/05/02 15:27 UTC
Read the original article Hit count: 315

Filed under:
|
|
|
|

Hi all guys!

still on regex! i want learn it but i'm still crashing the head into my keybord! ;-)

ok very trivial for you, i'm sure!

Assuming i have this sting, the \s is where the space actualy is... \n where linebreak is..

   DESCRIPTION: The quick brown fox jum`\s\n`
   `\s`ps over the lazy dog

now, what i need to do is remove All the space after the A-Z:

that i have achieved by this regex: /\s+(?![A-Z:])/m that produce this result

DESCRIPTION: The quick brown fox jum ps over the lazy dog

as you can see it leave the space between jum and ps

how to have a result like this?

DESCRIPTION: The quick brown fox jumps over the lazy dog

thank's for the time!

© Stack Overflow or respective owner

Related posts about php

Related posts about regex