I need this regular expression for this format
(##.####)
I think it should be something like this
/[0-9]*[.][0-9]/
I need this regular expression for this format
I think it should be something like this
|
||||
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.
I'll bite. This should work:
And if you need the parantheses:
|
|||||||
|
I assume, that the brackets does not belong to the pattern. Use the quantifier The next important point is, you need to anchor your regex to avoid getting partial matches:
|
|||
|
XRegExp
is a lib, not the native JSRegExp
constructor. Besides, for something this easy, there really isn't a need to overcomplicate things IMO – Elias Van Ootegem 8 hours ago