Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. (((x12 & x20) & x05) | x02) | ((x12 & x13)) | (x13 | x20)
  2.  
  3. import re
  4. string = '(((x12 & x20) & x05) | x02) | ((x12 & x13)) | (x13 | x20)'
  5. result = re.findall('(([^(].*?))', string)
  6. # --> ['x12 & x20', 'x12 & x13', 'x13 | x20']
  7. print('({})'.format(result[0]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement