javascript object RegExp

References

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

Coding Advice

# If the match fails, the exec() method returns null.

var match = /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(str);
if (match && match[0]) { 

Points to Remember

Special characters
\ ^ $ . * + ? ( ) [ ] { } |

Leave a Reply

Close Menu