gawseed/algorithm/generic.py
def re_match_one(item, args):
    """Matches a regex with a group (argument 2) against the column (number in argument 1)"""
    import re

    # setup
    (re_col, re_expr) = args
    if re_expr not in compiled_res:
        compiled_res[re_expr] = re.compile(re_expr)

    # test if a match occurred
    match = compiled_res[re_expr].search(item[re_col])
    if match:
        return [match.group(1), '']
    return ['','']
Matches a regex with a group (argument 2) against the column (number in argument 1)
Matches a regex with a group (argument 2) against the column (number in argument 1)
Matches a regex with a group ( argument 2 ) against the column ( number in argument 1 )
def re_match_one(item, args):
    import re
    (re_col, re_expr) = args
    if re_expr not in compiled_res:
        compiled_res[re_expr] = re.compile(re_expr)
    match = compiled_res[re_expr].search(item[re_col])
    if match:
        return [match.group(1), '']
    return ['','']
def re_match_one ( item , args ) : import re ( re_col , re_expr ) = args if re_expr not in compiled_res : compiled_res [ re_expr ] = re . compile ( re_expr ) match = compiled_res [ re_expr ] . search ( item [ re_col ] ) if match : return [ match . group ( 1 ) , '' ] return [ '' , '' ]
Matches a regex with a group (argument 2) against the column (number in argument 1)
Matches a regex with a group ( argument 2 ) against the column ( number in argument 1 )
"""Matches a regex with a group (argument 2) against the column (number in argument 1)""" # setup # test if a match occurred
item
args