import rerx = r"s[4-9]\d*"text = "s000000000 s1133122 s21 s3 s4 s5212638476234857634 s6 s7 s8 s9000"print( re.findall(rx, text) )
Standard input is empty
['s4', 's5212638476234857634', 's6', 's7', 's8', 's9000']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!