Programming Languages JavaScript Objective
Mar 06, 2013

<script type="text/javascript">

 var s = "9123456 or 80000?";

 var pattern = /\d{4}/;

 var output = s.match(pattern);

 document.write(output);

 </script>

Choose the correct answer:
A) 9123
B) 91234
C) 80000
D) 9123456
Detailed Explanation

Option A is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback