Category : nsregularexpression

I need to extract three patterns from the given string of numbers separated by a comma. data= "2,2,2,2,4,3,2,4,3, 2,2,2,2,4,3,4,3,2,4,3,4,3, 2,2,2,2,2,4,3,4,3,3,2,4,3,4,3,3 ,2,2,2,3,4,4, 2,2,2,2,4,3,2,4,3 and so on" Given pattern to find out from the string. 2,2,2,2,4,3,2,4,3 So to extract the given pattern, I wrote a regex. pattern one: re.findall(r’2,2,2,2,4,3,2,4,3′, data) pattern two to build: But in reality,4 ..

Read more