Ad Widget

Collapse

vfs.file.regexp problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azurit
    Junior Member
    • Aug 2007
    • 23

    #1

    vfs.file.regexp problem

    Hi,

    according to the documentation, 'vfs.file.regexp' should return matched string only. But if i try anything, i'm always getting the whole line where the matched string is. Any suggestions?


    file content:
    11.36 10.95 9.49

    pattern:
    ^([0-9\.]+)

    result:
    11.36 10.95 9.49

    expected result (first 'word'):
    11.36


    I tried the pattern with python and it looks like it's working fine:

    >>> import re
    >>> re.findall("^([0-9\.]+)", "11.36 10.95 9.49")
    ['11.36']
Working...