Chemistry Regex: SMILES, InChi, InChiKey notation validated by regular expressions

The following code can be used to parse SMILES and InChi strings.Free for use, and hopefully saving you some time. 

SMILES Or the Simplified Molecular-Input Line-Entry System or SMILES is a specification in form of a line notation for describing the structure of chemical molecules using short ASCII strings (Source: Wikipedia, Publication[1] )

Meanwhile watch out for slated additions to the Data-hub to get tons of free scientific data-formats to base your parser work on. Is-lib as one of the best additions to underscore.js alongside your favorite javascript-library like jQuery, mootools or Porotype (The link leads you to a google CDN host). News on its successor gist-lib is to be found here.

Generation of SMILES: Break cycles, then write as branches off a main backbone. Source: Wikipedia, Author:Fdardel

Feel free to use all code, if not stated otherwise, under the very lenient MIT-licence.

[1] David Weininger, "SMILES, a chemical language and information system. 1. Introduction to methodology and encoding rules" J. Chem. Inf. Comput. Sci., 1988, 28 (1), pp 31–36