regex - Python Regular expression matching integer after a tab -


how can match integer written after tab? regular expression that?

i have tried this:

line = '0     1' re.match('\t+\d',line) 

but not work - 1 not matched.

i want 1 matched , returned.

the reason regex failing tab 4 spaces. if string more complex example, can use \s+ match 1 or more whitespace characters ( of [ \t\n\r\f\v]):

import re line = "0     1" print re.findall("\s+(\d+)", line) 

which prints

['1'] 

if string isn't more complex example, can use vks' solution , match digits ("\d+$").


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -