fork(2) download
  1.  
  2. import re
  3. myarray = "blahb.blah = myarray({-68,-67,-65,-62,-61,-59,-58,-56,-55,-53,-52,-51,-49,-48,-47,-46,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-29,-28,-27,-26,-26,-25,-24,-24,-23,-22,-22,-21,-21,-20,-20,-19,-19,-19,-18,-18,-18,-17,-17,-17,-16,-16,-16,-15,-15,-15,-14,-14,-14,-14,-13,-13,-13,-12,-12,-12,-11,-11,-11,-10,-10,-9.7,-9.4,-9.1,-8.8,-8.5,-8.2,-7.9,-7.5,-7.2,-6.9,-6.6,-6.3,-6,-5.7,-5.3,-5,-4.7,-4.4,-4.1,-3.8,-3.4,-3.1,-2.8,-2.5,-2.2,-1.9,-1.6,-1.2,-0.9,-0.6,-0.3,0,0.3,0.6,1,1.3,1.6,1.9,2.2,2.5,2.9,3.2,3.5,3.8,4.1,4.4,4.7,5.1,5.4,5.7,6}, x*456, 1);"
  4.  
  5. matchObj = re.search( r".+?(=*)(myarray\()\{([\S| \|'.,]*)},\s*(\w+)(.*\*\d+)", myarray)
  6. #matchObj = re.search( r"(\d+)(.*)", myarray)
  7.  
  8. print matchObj
  9. print "matchObj.group() : ", matchObj.group()
  10. print "matchObj.group(1) : ", matchObj.group(1)
  11. print "matchObj.group(2) : ", matchObj.group(2)
  12.  
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
<_sre.SRE_Match object at 0x558b10e0>
matchObj.group() :  blahb.blah = myarray({-68,-67,-65,-62,-61,-59,-58,-56,-55,-53,-52,-51,-49,-48,-47,-46,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-29,-28,-27,-26,-26,-25,-24,-24,-23,-22,-22,-21,-21,-20,-20,-19,-19,-19,-18,-18,-18,-17,-17,-17,-16,-16,-16,-15,-15,-15,-14,-14,-14,-14,-13,-13,-13,-12,-12,-12,-11,-11,-11,-10,-10,-9.7,-9.4,-9.1,-8.8,-8.5,-8.2,-7.9,-7.5,-7.2,-6.9,-6.6,-6.3,-6,-5.7,-5.3,-5,-4.7,-4.4,-4.1,-3.8,-3.4,-3.1,-2.8,-2.5,-2.2,-1.9,-1.6,-1.2,-0.9,-0.6,-0.3,0,0.3,0.6,1,1.3,1.6,1.9,2.2,2.5,2.9,3.2,3.5,3.8,4.1,4.4,4.7,5.1,5.4,5.7,6}, x*456
matchObj.group(1) :  
matchObj.group(2) :  myarray(