Regular expression \p{L} and \p{N}

Diemauerdk picture Diemauerdk · Feb 15, 2013 · Viewed 114.1k times · Source

I am new to regular expressions and have been given the following regular expression:

(\p{L}|\p{N}|_|-|\.)*

I know what * means and | means "or" and that \ escapes.

But what I don't know what \p{L} and \p{N} means. I have searched Google for it, without result...

Can someone help me?

Answer

Cerbrus picture Cerbrus · Feb 15, 2013

\p{L} matches a single code point in the category "letter".
\p{N} matches any kind of numeric character in any script.

Source: regular-expressions.info

If you're going to work with regular expressions a lot, I'd suggest bookmarking that site, it's very useful.