Regex test for any non digit, but . is ok

How can I test a variable for any non digit, but not match a decimal point. Right now I have:


if(/\\D/.test($variable)){ 
            return false;
}
else {
            return true;
}

how can I make the regex not match decimal points?
Thanks for any help.

This picks up more than one point even if they are not adjacent:

/[^0-9\\.]|(\\.[^\\.]*\\.)/

I think that’s what I needed. Thanks.

is there a way to change [^.0-9] to match more than 1 decimal point. so one decimal point would be ignored. but it would match a second?

Try this: [^.0-9]