Improved regular expression and more tests
Bug fixes for first character in document
Release 2.2.5