ユーザーの電話番号を検証するために RegEx を使用していました。電話番号検証の一連の要件があります。RegEXについてはよくわかりません。私の要件に一致するreqexを提供するのを手伝ってくれる人はいますか。ここでの検証は非常に簡単です。
条件
1. It should allow numbers from 0-9.
2. It should allow + sign. (+ sign is not mandatory but not allow after even a single letter (ie: should be placed at front.)).
3. It should allow - sign. (- sign is also not mandatory and can be placed anywhere)
4. It should allow empty space everywhere.
5. No dots or no other chars allowed except the above said things.
正しい値
+65-12345678
65-12345678
6512345678
65 12345678
65 123 45678
65 123-45678
+65 123-45678
1234
不適切な値
12345+86666
123alpha
ありがとう