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})?$");