diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-06-19 11:40:53 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-06-19 11:40:53 +1200 |
commit | 6785ec225ae4657ec8742e89a9d7653ad91e01ca (patch) | |
tree | 7a624963fef5cdcd51725a89e866b95801c282e6 /urxvt/ext | |
parent | Ignore well-meaning -before- critique (diff) | |
download | dotfiles-6785ec225ae4657ec8742e89a9d7653ad91e01ca.tar.gz dotfiles-6785ec225ae4657ec8742e89a9d7653ad91e01ca.zip |
Simplify/tidy regex calls
Diffstat (limited to 'urxvt/ext')
-rw-r--r-- | urxvt/ext/selection | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/urxvt/ext/selection b/urxvt/ext/selection index edc1a1bb..2ca08011 100644 --- a/urxvt/ext/selection +++ b/urxvt/ext/selection @@ -21,7 +21,7 @@ sub on_init { if ( defined( my $res = $self->resource('cutchars') ) ) { $res = $self->locale_decode($res); push @{ $self->{patterns} }, - qr{\G [\Q$res\E[:space:]]* ([^\Q$res\E[:space:]]+) }x; + qr{\G [\Q$res\E[:space:]]* ([^\Q$res\E[:space:]]+) }msx; } $self->{enabled} = 1; @@ -49,7 +49,7 @@ sub on_sel_extend { study $text; # _really_ helps, too :) for my $regex ( @{ $self->{patterns} } ) { - while ( $text =~ /$regex/g ) { + while ( $text =~ m{$regex}gmsx ) { if ( $LAST_MATCH_START[1] <= $markofs and $markofs <= $LAST_MATCH_END[1] ) { |