Fix fromString() conversion bug

Fixes string conversion bug found when using library in another project - on the whole testing preg_match !== 1 is a safer test.