I built my own regex exp
r'(\d+[x]\d+[-._](\w+))|(\d+[x]\d+\w+)'
alphanumeric 1x01-e02-03-04
hello-char 2x01-02-03_04
hello 3x02 char 2x01-02-03_04
I have to grab the sub-strings '1x01' and 'e02', '03', '04' or '2x01','02' etc..
String length is variable, for example:
alphanumeric 1x01-e02-03-04
or
alphanumeric 1x01-e02
The first sub-string is always "nnnxnnn" where n is an integer ( max three digit) and the char 'x' is always present in string. The 'e' char is the only letter after 'x' but it's not always present for example 'e02' and '03', but I need both integer.
Is it possible to improve it?
3x02too? What if there are just numbers somewhere, likehello 33 char 2x01-02-03_04?e02-03-04? Should they always be part of a string that contains anxorechar? You don't want to match a standalone number?