Regex for quality, strength. Fixes #31

Fixes #31 by making regex capable of handling different formats, and checks for a valid match before using it.