dedlfix: PCRE: wieviel Leerzeichen frisst eine Wortgrenze?

Beitrag lesen

echo $begrüßung;

Meine Fragen: sind der Punkt, Komma etc. _und_ die Leerzeichen zwischen Vor- und Nachname durch das \b abgedeckt?
Gelten die Häkchen aus als Wortgrenze?
Im PCRE-Manual habe ich es nicht gefunden, aber das ist auf englisch und da übersehe ich gerne mal was...

Reicht dir auch das PHP-Handbuch, Seite PCRE Pattern Syntax?

Da gibt es keine Anker, deswegen als Zitat:

»A word boundary is a position in the subject string where the current character and the previous character do not both match \w or \W (i.e. one matches \w and the other matches \W), or the start or end of the string if the first or last character matches \w, respectively.«

Gefunden unterhalb der Auflistung, in der \b und \B enthalten ist. Über der Auflistung befindet sich auch noch eine Definition von \w und \W:

»A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The definition of letters and digits is controlled by PCRE's character tables, and may vary if locale-specific matching is taking place. For example, in the "fr" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by \w.«

echo "$verabschiedung $name";