view release on metacpan or search on metacpan
lib/App/Greple/jq.pm view on Meta::CPAN
}
qr{
^ (${level} $indent_re*) "$label_re": .* \n
(?:
## single line key-value pair
\g{-1} $indent_re $start_with .++ \n
|
## indented array/hash
\g{-1} $indent_re \S .* [\[\{] \n
(?: \g{-1} $indent_re \s .*+ \n) *+
\g{-1} $indent_re [\]\}] ,? \n
) *?
}xm;
}
};
push @prefix_re, $prefix_re if $prefix_re;
lib/App/Greple/jq.pm view on Meta::CPAN
$label =~ s/%/.*/g;
my($label_re, $pattern_re) = map re($_), $label, $pattern;
my $re = qr{
@prefix_re \K
^
(?(<level>) (?= \g{level} $indent_re \S ) ) # required level
(?<in> [ ]*) "$label_re": [ ]*+ # find given label
(?: . | \n\g{in} \s++ ) * # and look for ...
$pattern_re # pattern
(?: . | \n\g{in} (?: \s++ | [\]\}] ) ) * # and take the rest
}xm;
warn "$re\n" if $config{debug};
match_regions pattern => $re;
}
1;
__DATA__
define JSON-OBJECTS ^([ ]*)\{(?s:.*?)^\g{-1}\},?\n
option default --json-block --jq-filter
option --jq-filter --if='jq "if type == \"array\" then .[] else . end"'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Greple/md.pm view on Meta::CPAN
s{(?<![!\e])\[($LT)\]\(<?([^>)\s\n]+)>?\)}{
protect(osc8($2, md_color('link', "[$1]")))
}ge;
},
inline_code => sub {
s/(?<bt>`++)(((?!\g{bt}).)+)(\g{bt})/
protect(md_color('code_tick', $+{bt}) . md_color('code_inline', $2) . md_color('code_tick', $4))
/ge;
},
headings => sub {
my $hashed = $config->{hashed};
lib/App/Greple/md.pm view on Meta::CPAN
option default \
-G --filter --filestyle=once --color=always \
--begin &__PACKAGE__::begin
define {CODE_BLOCK} ^ {0,3}(?<bt>`{3,}+|~{3,}+)(.*)\n((?s:.*?))^ {0,3}(\g{bt})
define {COMMENT} ^<!--(?![->])(?s:.+?)-->
define {TABLE} ^ {0,3}([â|â].+[â|â¤]\n){3,}
define {LIST_ITEM} ^\h*(?:[*-]|(?:\d+|#)[.)])\h+.*\n
define {DEFINITION} (?:\A|\G\n|\n\n).+\n\n?(:\h+.*\n)
view all matches for this distribution
view release on metacpan or search on metacpan
share/sccc2.dict view on Meta::CPAN
#
# C/C++ã»ãã¥ã¢ã³ã¼ãã£ã³ã° 第2ç
# https://www.jpcert.or.jp/securecoding_book_2nd.html
#
([ããããã¯ã«ãª])\g{-1} //
(?<!ã)ã®ã® //
(?:ã¸ã«|ã«ã¸) //
(ä¸|ã²ã¨)㤠// ã²ã¨ã¤
(è¿|ã¾ã§) // ã¾ã§
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Greple/xlate/Filter.pm view on Meta::CPAN
}
sub _colon {
s{
(^|\G)
(?<pre> (?<p>.+)?) (?<mark> :{7,}) \s+ (?<l1> ($RE{LANG})) \n
(?<t1> .+) \g{mark} \n
\g{mark} \s+ (?<l2> ($RE{LANG})) \n
(?<t2> .+) \g{mark} \n
(?<post> (?(<p>) ((?!:{7}).)* | ((?!:{7}).)+ )) \n?
}{
<<~EOF;
$+{mark} $+{l1}
$+{pre}$+{t1}$+{post}
view all matches for this distribution
view release on metacpan or search on metacpan
it.
Order of capture group in the pattern is not guaranteed. Please avoid
to use direct index, and use relative or named capture group instead.
For example, if you want to search repeated characters, use
`(\w)\g{-1}` or `(?<c>\w)\g{c}` rather than
`(\w)\1`.
Extended Bracketed Character Classes (`(?[...])`) and Variable Length
Lookbehind can be used without warnings. See
["Extended Bracketed Character Classes" in perlrecharclass](https://metacpan.org/pod/perlrecharclass#Extended-Bracketed-Character-Classes) and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/JobLog/TimeGrammar.pm view on Meta::CPAN
(?<us>
(\d{1,2}) (?{ $b1 = $^N })
((?÷r))
(\d{1,2}) (?{ $b2 = $^N })
\g{-2}
(\d{4})
(?{
$buffer{year} = $^N;
$buffer{month} = $b1;
$buffer{day} = $b2;
lib/App/JobLog/TimeGrammar.pm view on Meta::CPAN
(?<iso>
(\d{4}) (?{ $b1 = $^N })
((?÷r))
(\d{1,2}) (?{ $b2 = $^N })
\g{-2}
(\d{1,2})
(?{
$buffer{year} = $b1;
$buffer{month} = $b2;
$buffer{day} = $^N;
lib/App/JobLog/TimeGrammar.pm view on Meta::CPAN
: (?<minute>\d++)
(?:
: (?<second>\d++)
)?
)?
(?: \s*+ (?<suffix>[ap]) (\.?)m\g{-1})?
/ix;
my ( $hour, $minute, $second, $suffix ) =
( $+{hour}, $+{minute} || 0, $+{second} || 0, lc( $+{suffix} || 'x' ) );
$hour += 12 if $suffix eq 'p' && $hour < 12;
$suffix = 'p' if $hour > 11;
view all matches for this distribution