Regex in python to catch a string like MMS-2839 -
how can catch string these regex in python?
m1sxs-2839 mcs-28s9213 both first , second part (divided -) can contains letters , numbers (case insensitive).
you may try below re.match function.
re.match(r"(?i)[a-z0-9]+-[a-z0-9]+$", st) (?i) helps case-insensitive match. since re.match scans input start, don't need add start of line anchor ^ explicitly.
Comments
Post a Comment