Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これらの入力サンプルの正規表現を書きたい:
اشک12345 اشکـ12345
私の考え:
"^[آ-ی][آ-ی][آ-ی][\ـ]?\d{5}"
しかし、うまくいきません。
別の正規表現を使用してみてください:
[0-9]*[\u0600-\u06FF]*
または
[\u0600-\u06FF]*[ـ]?[\d{5}]+
あるいは
[\w{Arabic}]*[ـ]?[\d{5}]+
2つのグループを一致させるために使用できます
(?'head'[\w{Arabic}]{3})[ـ]?(?'index'[\d{5}]+)
その結果、次の 2 つのグループになります。
head: اشک index: 12345