still on regex! I want to learn this, but I'm still breaking my head into my key !; -)
ok is very trivial for you, I'm sure!
Assuming I have this sting, \sthis is the place where the actual space is ... \nwhere linebreak is ..
Edition:
OTHERFIELD: Other text here...`\n`
DESCRIPTION: The quick brown fox jum`\s\n`
`\s`ps over the lazy dog
OTHERFIELD: Other text here...`\n`
just to explain:
each line always begins with the word UPPERCASE followed by a colon!
so the only way I have to break down each line is the last one \n, so I can't delete it!
then I preg_splitting each cleared line with this regex
/$\R?[^A-Z:]*/m
which give me such an array:
[DESCRIPTION] => The quick brown fox jumps over the lazy dog
now what i need to do is remove all the space after A-Z:
: /\s+(?![A-Z:])/m,
DESCRIPTION: The quick brown fox jum ps over the lazy dog
, jum ps
?
DESCRIPTION: The quick brown fox jumps over the lazy dog
!