public function csl_name::get_utf8_regex in Bibliography Module 7
Same name and namespace in other branches
- 6.2 modules/CiteProc/CSL.inc \csl_name::get_utf8_regex()
- 7.2 modules/CiteProc/CSL.inc \csl_name::get_utf8_regex()
1 call to csl_name::get_utf8_regex()
- csl_name::get_regex_patterns in modules/
CiteProc/ CSL.inc
File
- modules/
CiteProc/ CSL.inc, line 950 - CiteProc-PHP.
Class
Code
public function get_utf8_regex() {
// Matches Unicode letters & digits:
// Unicode-aware equivalent of "[:alnum:]".
$alnum = "\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}\\p{Nd}";
// Matches Unicode letters:
// Unicode-aware equivalent of "[:alpha:]".
$alpha = "\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}";
// Matches Unicode control codes & characters not in other categories:
// Unicode-aware equivalent of "[:cntrl:]".
$cntrl = "\\p{C}";
// Matches Unicode dashes & hyphens:
$dash = "\\p{Pd}";
// Matches Unicode digits:
// Unicode-aware equivalent of "[:digit:]".
$digit = "\\p{Nd}";
// Matches Unicode printing characters (excluding space):
// Unicode-aware equivalent of "[:graph:]".
$graph = "^\\p{C}\t\n\f\r\\p{Z}";
// Matches Unicode lower case letters:
// Unicode-aware equivalent of "[:lower:]".
$lower = "\\p{Ll}\\p{M}";
// Matches Unicode printing characters (including space):
// same as "^\p{C}", Unicode-aware equivalent of "[:print:]".
$print = "\\P{C}";
// Matches Unicode punctuation (printing characters excluding letters & digits):
// Unicode-aware equivalent of "[:punct:]".
$punct = "\\p{P}";
// Matches Unicode whitespace (separating characters with no visual representation):
// Unicode-aware equivalent of "[:space:]".
$space = "\t\n\f\r\\p{Z}";
// Matches Unicode upper case letters:
// Unicode-aware equivalent of "[:upper:]".
$upper = "\\p{Lu}\\p{Lt}";
// Matches Unicode "word" characters:
// Unicode-aware equivalent of "[:word:]" (or "[:alnum:]" plus "_")
$word = "_\\p{Ll}\\p{Lu}\\p{Lt}\\p{Lo}\\p{Nd}";
// Defines the PCRE pattern modifier(s) to be used in conjunction with the above variables:
// More info: <http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php>
// the "u" (PCRE_UTF8) pattern modifier causes PHP/PCRE to treat pattern strings as UTF-8.
$patternModifiers = "u";
return array(
$alnum,
$alpha,
$cntrl,
$dash,
$digit,
$graph,
$lower,
$print,
$punct,
$space,
$upper,
$word,
$patternModifiers,
);
}