A simple Regular Expression analyzer in JavaScript