python - Creating a Regex That Applies to multiple lengths of strings and characters -


play [[b2 c3# d3 d3# ]] play [[a1 a1# b1 d1# e1 f1 f1# g1 a2 b2 f2# g2 c3 c3# d3 d3# ]] 

i need create regex (with ultimate purpose of removing "play" , "[[]]" lines of text file. insides of brackets vary each line, how create regex match pattern return group within brackets each line?

any appreciated, i'm kind of noob this.

since know start , end strings , lengths, slice part need:

>>> s = "play [[a1 a1# b1 d1# e1 f1 f1# g1 a2 b2 f2# g2 c3 c3# d3 d3# ]]" >>> s[7:-3] 'a1 a1# b1 d1# e1 f1 f1# g1 a2 b2 f2# g2 c3 c3# d3 d3#' 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -