I need a regex expression for this
any number. and again the number and.
So it really is
1.3.164.1.2583.15.46 546.598.856.1.68.268.695.5955565
but
5.......... ...56.5656
invalid
I tried templates like:
pattern = "[0-9](\\.[0-9]?*)?*"; pattern = "[0-9](\\.[0-9]?*)?$"; pattern = "[^0-9\\.]";
but not one of them meets my requirement. Please, help?
My existing code
String PATTERN="\\d+(\\.\\d+)*"; @Override public void insertString(int arg0, String arg1, AttributeSet arg2) { if(!arg1.matches(this.PATTERN)) return; super.insertString(arg0, arg1, arg2); }
source share