0

I have string that i get as input which contain json date in format /Date(1234043600000)/ my question is how can I verify that the input is exactly with the json date format ?

I guess I should use /[0-9] / but how I should do it for all the date pattern?

1
  • JSON doesn't have date type, date formatting in json is rather a facility of the library you are using (Jackson, Gson...) Commented Aug 8, 2013 at 10:37

1 Answer 1

1

JSON doesn't actually have a native Date type like JavaScript does. It uses strings for that. However, it looks like you are using a JSON string that matches up the string Date with a UNIX timestamp. To match that you'd do this:

/Date\([\d]+\)/
Sign up to request clarification or add additional context in comments.

2 Comments

You can simplify [\d] to just \d
Thanks , I want to check it and when i put it like this I have error in the brackets Matcher matcher = pattern.matcher('/Date(\d+)/'); any idea?

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.