by Mofi » Tue Jun 19, 2012 1:11 am
Well, ^p matches only DOS line terminators - carriage return + line-feed. ^p is short for ^r^n. That explains also why [^p] finds also Unix line terminators as this is resolved internally to [^r^n] and means now either carriage return or line-feed. Better would be [^p]+ as this results internally in [^r^n]+ and therefore matches now also DOS line terminators completely and not just the carriage return of a CR+LF pair. But care must be taken as [^p]+ matches now also multiple line terminators of any type.
^n should be used for UNIX line terminators as this special character matches only the line-feed.
The internal replacement of [^p] by [^r^n] explains also why ^p used in a function string regular expression in a wordfile results in working for DOS, UNIX and MAC files taking into account that ususally after ] there is either + or * too.