Java Programming
primer-original-v2mediumJava Programming05 Regular Expressionprimer-original-v2

What is the regular expression to match any date in the format "yyyy-mm-dd" in a string?

Answer options

A
\d{4}-\d{2}-\d{2}
B
\d{2}/\d{2}/\d{4}
C
[0-9]{4}.[0-9]{2}.[0-9]{2}
D
\d{4}\d{2}\d{2}

Correct answer: \d{4}-\d{2}-\d{2}

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Java Programming, understanding the underlying mechanics of Java Programming is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Java Programming questions

Practice more Java Programming questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.