Fix bug in regex matching when loading key from PEM file.