Fixed bug that function name inconsistency in doctest
Fixed regexp bug and merged doctest to __doc__