- or download this
$ perl -we 'q{xxx.xxx} =~ /\b(xxx\.xxx)\b/; print "|$1|\n"'
|xxx.xxx|
$ perl -we 'q{.xxx} =~ /\b(\.xxx)\b/; print "|$1|\n"'
Use of uninitialized value $1 in concatenation (.) or string at -e lin
+e 1.
||
- or download this
$ perl -we 'q{xxx.xxx} =~ /(?<!\w)(xxx\.xxx)(?!\w)/; print "|$1|\n"'
|xxx.xxx|
$ perl -we 'q{.xxx} =~ /(?<!\w)(\.xxx)(?!\w)/; print "|$1|\n"'
|.xxx|
- or download this
$ cat log_to_read.txt
1 abc
...
def
ghi
$@%
- or download this
#!/usr/bin/env perl
...
open my $out_fh, '>', 'log_lines_matched.txt';
/$log_search_re/ && print $out_fh $_ while <$log_fh>;
}
- or download this
$ cat log_lines_matched.txt
1 abc
...
6 ghi
9 abc def ghi
10 $@%