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.
次のパターンの式の正規表現 (java) は何ですか?
currency-symbol=digit(min length=0, max length=4).(optional)digit(min length=0, max length=4)
例えば:
eur=1 gbp=3.2 usd=40.05 AUD=0.33
[a-zA-Z]{3}=\d{0,4}([.]\d{0,4})?
私は以下を使用します:
Pattern pattern = Pattern.compile("^[a-zA-Z]{3}=\\d{0,4}(\\.\\d{0,4})?$");