I want to find a match in string for the following pattern (field1)(field2)(field3)
field 1 can be either 'alpha' or 'beta' or 'gamma' field 2 is any number(can be whole number or decimal) field 3 is 'dollar' or 'sky' or 'eagle' or 'may'
Input string1 : "There is a string which contains alpha 2 sky as a part of it" Output1: alpha 2 sky
Input string2 : "This sentence contains a pattern beta 10.2 eagle" Output2: beta 10.2 eagle
I'm trying the following code but it's not flexible to include the multiple string matches together. value = " This sentence contains a pattern beta 10.2 eagle"
match = re.findall("beta \d.* dollar", value)
match = re.search("[beta | alpha | gamma]* \d.* [dollar | sky | eagle | may]*", value)something like this ?[...]means character set?