preg_replace and preg_match are ignoring \h (horizontal whitespace) and \v (vertical whitespace) flags, and I can’t figure out why.
$text = preg_replace('/[\h]+/', ' ', $text);
That line should replace any string of consecutive horizontal whitespace characters with a single space. Instead, it is replacing the letter ‘h’.
I have PCRE 6.6 installed. I’m aware of [:blank:] as a replacement for \h but I can’t find any alternative for \v (and of course I’d prefer to just figure out why these are not working instead of replacing them with something else)
It’s not supported in your version of PCRE.
http://www.pcre.org/changelog.txt
The changelog says
\hhas been added in version 7.2