What does the regex pattern 'pL' do?

php, preg-replace, regex

Solution

`\\pL` is a Unicode property shortcut. It can also be written as as`\p{L}` or `\p{Letter}`. It matches any kind of letter from any language.

Problem

There is a common Regex used to slugify urls `~[^\\pL\d]+~u` but what does the`\\pL` in the first `preg_replace()` mean? Here are some examples: - How can I replace ":" with "/" in slugify function? - http://snipplr.com/view/22741/slugify-a-string-in-php/ - http://sourcecookbook.com/en/recipes/8/function-to-slugify-strings-in-php - http://www.daniweb.com/web-development/php/threads/471380/php-slugify-two-variables-together

Original source

Related problems