import reexample = "Hi<Hi(now)>_(.)"regex = re.compile(r"(<[^<>]*>)|\([^()]*\)")print( re.sub(regex, r'\1', example) )
Standard input is empty
Hi<Hi(now)>_
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!