Apply the regex for checking sg_code.
Fix #11.