Update regex and fix label generation