Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- txt='fo_baro(b(a)ar)'
- re1='((?:[a-z][a-z]+))' # Ukaz
- re2='(\\(.*\\))' # Vrednost
- rg = re.compile(re1+re2,re.IGNORECASE|re.DOTALL)
- m = rg.search(txt)
- if m:
- word=m.group(1)
- rbraces=m.group(2)
- print 'Ukaz: %s' % word
- print 'Vrednost: %s' % rbraces
Add Comment
Please, Sign In to add comment