Goto main content

getre

This function return the value of a named parameter in a regular expression.

GETOFFSET

NAME

getoffset - This function returns the position of the last match regular expression

SYNOPSIS

getoffset(); 

DESCRIPTION

This function returns the position of the last match regular expression.

EXAMPLES

        a = "a2b4c6d8e";
        while a =~ "(\d+)" do
            getre(1);
            offset = getoffset();
            offset; ",";
            a = substr(a, offset);
        endw

        return 22,42,62,82,

        a = "123456789";
        a =~ "1"; getoffset();
        a =~ "2"; getoffset();
        a =~ "3"; getoffset();
        a =~ "4"; getoffset();
        a =~ "5"; getoffset();
        a =~ "6"; getoffset();
        a =~ "7"; getoffset();
        a =~ "8"; getoffset();
        a =~ "9"; getoffset();
 

        return true1true2true3true4true5true6true7true8true9

        a = "a1b2c3";
        a =~ '(\d+)';
        getre(1);
        getoffset();
        getnbre();
 

        return true122

        a = "a1b2c3";
        a =~ '^(.\d+)(.\d+)(.\d+)$';
        nb = getnbre();
        nb; ":";
        for(i=0;i<nb; ++i) do
            i; ":"; getre(i);
        endfor
        getoffset();

        return true4:0:a1b2c31:a12:b23:c36

SEE ALSO

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.