Skip to content

Method interpolation in regexes #77

@choroba

Description

@choroba

Perl doesn't interpolate method calls in double quoted strings and regexes, so the following lines don't do what their authors hoped for:

$ grep -E '=~ /[^/]+->[^/]+/' -r lib
lib/Treex/Block/Misc/CreateWordToSentenceIndex.pm:    my @nodes = grep { $_->tag =~ /$self->tag_regex/ } $zone->get_atree()->get_descendants();
lib/Treex/Block/T2TAMR/ApplyRules.pm:                                                if ( $rule_node_parent->t_lemma =~ /{$target_tree_node->wild->{'query_label'}->{$query}}[0]/i ) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions