1
( (0)|(\d{1,3})([\,])(\d{2}))

we would like get pattern for pattern 0 or number format ***,** in input, where * is number. But we cann't find options for this regexp . How syntax will be right in this case?

Thanks!

5
  • Can you post some example? Commented Apr 18, 2015 at 9:18
  • What's wrong with what you have? (well, aside from the space at the beginning) Commented Apr 18, 2015 at 9:19
  • @RahulTripathi <input type="text" name="cost" required pattern="( (0)|(\d{1,3})([\,])(\d{2}))"> Commented Apr 18, 2015 at 9:21
  • @SecondRikudo we are get error enter the data in the specified format Commented Apr 18, 2015 at 9:22
  • the code you posted here...run it in fiddle.its working Commented Apr 18, 2015 at 9:35

1 Answer 1

2

The space at the beginning is what's causing you trouble.

<form action="foo.html">
    <input type="text" required pattern="((0)|(\d{1,3})([\,])(\d{2}))" />
    <button>Submit</button>
</form>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.