I want to match lines with negative numbers or/and decimal numbers with a ^
.
-1.2^-2.4
-12^2.4
-1^2
but not
1^2
1+2
I got [\^\D*]{2,}
but it is not working
Thanks in advance
I want to match lines with negative numbers or/and decimal numbers with a ^
.
-1.2^-2.4
-12^2.4
-1^2
but not
1^2
1+2
I got [\^\D*]{2,}
but it is not working
Thanks in advance
Would this work?
/^((-\d+|\.\d+)\^|.+\^(-\d+|\.\d+))/
matches a negative or decimal number followed by ^ or a ^ followed by a negative or decimal number.