我有以下的正則表達式,其允許僅字母:的Javascript正則表達式等效{L}
/[a-zA-Z]+/
a = "abcDF"
if (a.match(/[a-zA-Z]+/) == a){
//Match
}else{
//No Match
}
我怎樣才能做到這使用對{L}(通用 - 像德語,英語等任何語言。)
我試了一下:
a.match(/[p{l}]+/)
a.match(/[\p{l}]+/)
a.match(/p{l}/)
a.match(/\p{l}/)
但所有的字母返回null = 「AB」
更新問題 – user1767962