get first digit in a string in python
===

this is my first day with python and i'm stuck. I have a file which content looks like this:

 - Declaration //skip 
 - foo bar //shown as option 
 - Labels //skip 
 - 1 foo 
 - 2 foo
 - 3 bar 
 - 4 foo bar
 - ...
 - 23546477 bar bar bar bar foo

If the user choose foo, I just want to return 1,2, 4 and 23546477 and write in a file:
 
 - Target 1
 - Target 2
 - Target 4
 - Target 23546477

This is what I have come up so far:

    import sys
    import re
    
    def merge():
    
       if (len(sys.argv) > 1):
        labfile = sys.argv[1]
        f = open(labfile, 'r')
        f.readline()
        string = f.readline()
        print "Possible Target States:"
        print string
        var = raw_input("Choose Target States: ")
        print "you entered ", var
        f.readline()
        words = var.split()
        for line in f.readlines():
          for word in words:
    	    if word in line:
    	    m = re.match("\d+", line)
    	    print m
            //get the first number and store it in a list or an array or something else
    	    
        f.close()
    
    merge() 

unfortunately it is not working :P. 