How would you parse the ['i386', 'x86_64'] out of a string like '-foo 23 -bar -arch ppc -arch i386 -isysroot / -fno-strict-aliasing -fPIC'?
>>> my_arch_parse_function('-foo 23 -bar -arch i386 -arch x86_64 -isysroot / -fno-strict-aliasing -fPIC')
>>> ['i386', 'x86_64']
Can this be done using regex, or only using modules like PyParsing, or manually splitting and iterating over the splits?
Assumption: -arch VAL are grouped together.
Regex:
(?<=-arch )[^ ]+Arbitrary whitespace
P.S. There’s no
x86_64in that string, and are you trying to differentiate between-arch ppcand-arch i386?