How do I return yesterday day in the format of yyyy-mm-dd using JavaScript and using 
the regular expression below.
((19|20)\d\d)-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])
How do I return yesterday day in the format of yyyy-mm-dd using JavaScript and using 
the regular expression below.
((19|20)\d\d)-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])
 
    
     
    
    Native JS date formatting is very primitive (see this question for more details).
If you can, a better solution is to use Moment.js to make working with dates in JS much, much better.