Python RegEx Matching -


I have a string that I want to draw with a substrings. Currently I'm using 3 lines to get it:

  in my_list for z: abc = re.sub ('\ n', '', z [0] ) Xyz = re .sub ('SNMPv2-SMI ::', '', ABC) egg = re.sub ('\ .. * \ =. * $', '', Xyz)   

However, because it is using 3 different regex commands, is there a way to get the string to use a single statement / command?

bus | Use the ("or") operator:

  strng = re.sub ('r) (this) | (he) | (some more)', '', strng )    

Comments