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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -