Fixes bug in regex pattern

	* Adds the end of line character to the pattern in order to match the extension.
	* Changes index function for the strchr.