沃梦达 / 编程问答 / php问题 / 正文

正则表达式模式做什么?

What does the regex pattern #39;pL#39; do?(正则表达式模式做什么?)

本文介绍了正则表达式模式做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个常用的正则表达式用于标识URL~[^\pLd]+~u,但是第一个preg_replace()中的\pL是什么意思?

以下是一些示例:

  • 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

unicode

\pL是推荐答案属性快捷方式。也可以写为p{L}p{Letter}。它可以匹配来自任何语言的任何类型的字母。

这篇关于正则表达式模式做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:正则表达式模式做什么?