Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created January 13, 2020 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/4e1096db30cc3dd498c8cf288b58cd2a to your computer and use it in GitHub Desktop.
Save Whateverable/4e1096db30cc3dd498c8cf288b58cd2a to your computer and use it in GitHub Desktop.
greppable6
File Code
ALOREN/App-FindSource
…/fs :162:
my $ext = $fp.substr(($fp.rindex(".") // -1) + 1);
ALOREN/App-FindSource
…/fs :198:
return $filepath.substr(($filepath.rindex('/') // -1) + 1);
ALOREN/App-FindSource
…/Searcher.pm6 :8:
$!name.substr(0, $!name.rindex('.'));
ALOREN/Getopt-Advance
…/find-source.p6 :95:
if $fp.substr(($fp.rindex(".") // -1) + 1) (elem) %ext {
ALOREN/Getopt-Advance
…/find-source.p6 :113:
return $filepath.substr(($filepath.rindex('/') // -1) + 1);
ELIZABETH/P5built-ins
…/README.md :28:
quotemeta rand readdir readlink ref reset reverse rewinddir rindex say
ELIZABETH/P5built-ins
…/P5built-ins.pm6 :84:
quotemeta rand readdir readlink ref reset reverse rewinddir rindex say
ELIZABETH/P5built-ins
…/01-basic.t :12:
quotemeta rand readdir readlink ref reset reverse rewinddir rindex say
ELIZABETH/P5index
…/Changes :10:
- Merge rindex() code in here to reduce number of CPAN5 distributions.
ELIZABETH/P5index
…/META6.json :8:
"description" : "Implement Perl 5's index() / rindex() built-ins",
ELIZABETH/P5index
…/README.md :6:
P5index - Implement Perl 5's index() / rindex() built-ins
ELIZABETH/P5index
…/README.md :11:
use P5index; # exports index() / rindex()
ELIZABETH/P5index
…/README.md :17:
say rindex("foobar", "bar"); # 3
ELIZABETH/P5index
…/README.md :18:
say rindex("foofoo", "foo", 4); # 3
ELIZABETH/P5index
…/README.md :19:
say rindex("foofoo", "bar"); # -1
ELIZABETH/P5index
…/README.md :24:
This module tries to mimic the behaviour of the `index` / `rindex` functions of Perl 5 as closely as possible.
ELIZABETH/P5index
…/README.md :41:
rindex STR,SUBSTR,POSITION
ELIZABETH/P5index
…/README.md :42:
rindex STR,SUBSTR
ELIZABETH/P5index
…/P5index.pm6 :9:
sub rindex(Str() $string, Str() $needle, Int() $position = $string.chars - 1) is export {
ELIZABETH/P5index
…/P5index.pm6 :12:
!! $string.rindex($needle,$string.chars - 1 min $position) // -1
ELIZABETH/P5index
…/P5index.pm6 :19:
P5index - Implement Perl 5's index() / rindex() built-ins
ELIZABETH/P5index
…/P5index.pm6 :23:
use P5index; # exports index() / rindex()
ELIZABETH/P5index
…/P5index.pm6 :29:
say rindex("foobar", "bar"); # 3
ELIZABETH/P5index
…/P5index.pm6 :30:
say rindex("foofoo", "foo", 4); # 3
ELIZABETH/P5index
…/P5index.pm6 :31:
say rindex("foofoo", "bar"); # -1
ELIZABETH/P5index
…/P5index.pm6 :35:
This module tries to mimic the behaviour of the C<index> / C<rindex> functions
ELIZABETH/P5index
…/P5index.pm6 :52:
rindex STR,SUBSTR,POSITION
ELIZABETH/P5index
…/P5index.pm6 :53:
rindex STR,SUBSTR
ELIZABETH/P5index
…/01-basic.t :9:
ok defined(::('&rindex')), 'is &rindex imported?';
ELIZABETH/P5index
…/01-basic.t :10:
ok !defined(P5index::{'&rindex'}), 'is &rindex externally NOT accessible?';
ELIZABETH/P5index
…/03-rindex.t :7:
is rindex("foobar","bar"), 3, 'did we find bar';
ELIZABETH/P5index
…/03-rindex.t :8:
is rindex("foobar","bar",99), 3, 'did we find bar after end';
ELIZABETH/P5index
…/03-rindex.t :9:
is rindex("foofoo","bar"), -1, 'did we *not* find bar';
ELIZABETH/P5index
…/03-rindex.t :10:
is rindex("foofoo","foo",1), 0, 'did we find the first foo';
ELIZABETH/P5index
…/03-rindex.t :11:
is rindex("foofoo","foo",9), 3, 'did we find the second foo after end';
ELIZABETH/P5rindex
…/Changes :1:
Revision history for P5rindex
ELIZABETH/P5rindex
…/META6.json :10:
"description" : "Implement Perl 5's rindex() built-in [DEPRECATED]",
ELIZABETH/P5rindex
…/META6.json :12:
"name" : "P5rindex",
ELIZABETH/P5rindex
…/META6.json :15:
"P5rindex" : "lib/P5rindex.pm6"
ELIZABETH/P5rindex
…/META6.json :18:
"source-url" : "https://github.com/lizmat/P5rindex.git",
ELIZABETH/P5rindex
…/README.md :1:
Build Status
ELIZABETH/P5rindex
…/README.md :6:
P5rindex - Implement Perl 5's rindex() built-in [DEPRECATED]
ELIZABETH/P5rindex
…/README.md :11:
use P5rindex; # exports rindex()
ELIZABETH/P5rindex
…/README.md :13:
say rindex("foobar", "bar"); # 3
ELIZABETH/P5rindex
…/README.md :14:
say rindex("foofoo", "foo", 4); # 3
ELIZABETH/P5rindex
…/README.md :15:
say rindex("foofoo", "bar"); # -1
ELIZABETH/P5rindex
…/README.md :20:
This module tries to mimic the behaviour of the `rindex` of Perl 5 as closely as possible. It has been deprecated in favour of the `P5index` module, which exports both `rindex` and `index`. Please use that module instead of this one.
ELIZABETH/P5rindex
…/README.md :27:
Source can be located at: https://github.com/lizmat/P5rindex . Comments and Pull Requests are welcome.
ELIZABETH/P5rindex
…/dist.ini :1:
name = P5rindex
ELIZABETH/P5rindex
…/dist.ini :5:
filename = lib/P5rindex.pm6
ELIZABETH/P5rindex
…/P5rindex.pm6 :3:
module P5rindex:ver<0.0.3>:auth<cpan:ELIZABETH> {
ELIZABETH/P5rindex
…/P5rindex.pm6 :5:
BEGIN trait_mod:<is>(&rindex,:export);
ELIZABETH/P5rindex
…/P5rindex.pm6 :12:
P5rindex - Implement Perl 5's rindex() built-in [DEPRECATED]
ELIZABETH/P5rindex
…/P5rindex.pm6 :16:
use P5rindex; # exports rindex()
ELIZABETH/P5rindex
…/P5rindex.pm6 :18:
say rindex("foobar", "bar"); # 3
ELIZABETH/P5rindex
…/P5rindex.pm6 :19:
say rindex("foofoo", "foo", 4); # 3
ELIZABETH/P5rindex
…/P5rindex.pm6 :20:
say rindex("foofoo", "bar"); # -1
ELIZABETH/P5rindex
…/P5rindex.pm6 :24:
This module tries to mimic the behaviour of the C<rindex> of Perl 5 as closely as
ELIZABETH/P5rindex
…/P5rindex.pm6 :26:
both C<rindex> and C<index>. Please use that module instead of this one.
ELIZABETH/P5rindex
…/P5rindex.pm6 :32:
Source can be located at: https://github.com/lizmat/P5rindex . Comments and
ELIZABETH/P5rindex
…/01-basic.t :3:
use P5rindex;
ELIZABETH/P5rindex
…/01-basic.t :7:
ok defined(::('&rindex')), 'is &rindex imported?';
ELIZABETH/P5rindex
…/01-basic.t :8:
ok !defined(P5rindex::{'&rindex'}), 'is &rindex externally NOT accessible?';
ELIZABETH/P5rindex
…/01-basic.t :10:
is rindex("foobar","bar"), 3, 'did we find bar';
ELIZABETH/P5rindex
…/01-basic.t :11:
is rindex("foobar","bar",99), 3, 'did we find bar after end';
ELIZABETH/P5rindex
…/01-basic.t :12:
is rindex("foofoo","bar"), -1, 'did we *not* find bar';
ELIZABETH/P5rindex
…/01-basic.t :13:
is rindex("foofoo","foo",1), 0, 'did we find the first foo';
ELIZABETH/P5rindex
…/01-basic.t :14:
is rindex("foofoo","foo",9), 3, 'did we find the second foo after end';
JNTHN/Cro-Core
…/Uri.pm6 :426:
with $output.rindex('/') {
JNTHN/Cro-Core
…/Uri.pm6 :432:
with $output.rindex('/') {
JNTHN/Cro-Core
…/Uri.pm6 :457:
orwith $!path.rindex('/') {
JNTHN/Cro-HTTP
…/CookieJar.pm6 :40:
my $index = (rindex $path, '/') - 1;
MATIASL/Pygments
…/perl.py :101:
'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir',
MATIASL/Pygments
…/perl.py :274:
'reverse', 'rewind', 'rewinddir', 'rindex', 'roots', 'round',
TBROWDER/Text-More
…/create-md.p6 :477:
my $idx = rindex $line, '{';
TBROWDER/Text-More
…/create-md.p6 :548:
$s2 = split-line-rw($s1, ',', :max-line-length($max-line-length), :rindex(True));
TBROWDER/Text-More
…/create-pod6.p6 :477:
my $idx = rindex $line, '{';
TBROWDER/Text-More
…/create-pod6.p6 :548:
$s2 = split-line-rw($s1, ',', :max-line-length($max-line-length), :rindex(True));
TBROWDER/Text-More
…/ALL-SUBS.md :40:
UInt :$start-pos = 0, Bool :$rindex = False --> List)
TBROWDER/Text-More
…/ALL-SUBS.md :49:
UInt :$start-pos = 0, Bool :$rindex = False --> Str)
TBROWDER/Text-More
…/More.pm6 :221:
UInt :$start-pos = 0, Bool :$rindex = False --> List) is export(:split-line) {
TBROWDER/Text-More
…/More.pm6 :226:
if $rindex {
TBROWDER/Text-More
…/More.pm6 :228:
$idx = $spos ?? rindex $line, $brk, $spos !! rindex $line, $brk;
TBROWDER/Text-More
…/More.pm6 :250:
UInt :$start-pos = 0, Bool :$rindex = False --> Str) is export(:split-line-rw) {
TBROWDER/Text-More
…/More.pm6 :255:
if $rindex {
TBROWDER/Text-More
…/More.pm6 :257:
$idx = $spos ?? rindex $line, $brk, $spos !! rindex $line, $brk;
YNOTO/DB-Xoos
…/Xoos.pm6 :54:
my $mod-name = $f.path.substr($f.index("lib/$base")+4, $f.rindex('.') - $f.index("lib/$base") - 4);
TiMBuS/Net--IRC
…/TextUtil.pm :58:
my $index = $line.rindex(" ", $maxlen) || $maxlen;
andydude/p6-c-parser
…/gbytes.pp.c :2309:
char *rindex(const char *, int) ;
araraloren/perl6-app-findsource
…/fs :162:
my $ext = $fp.substr(($fp.rindex(".") // -1) + 1);
araraloren/perl6-app-findsource
…/fs :198:
return $filepath.substr(($filepath.rindex('/') // -1) + 1);
araraloren/perl6-app-findsource
…/Searcher.pm6 :8:
$!name.substr(0, $!name.rindex('.'));
araraloren/perl6-app-snippet
…/snippet.pm6 :314:
if $filename.rindex('.') -> $index {
araraloren/perl6-app-snippet
…/snippet.pm6 :323:
if $filename.rindex('.') -> $index {
araraloren/perl6-getopt-advance
…/find-source.p6 :95:
if $fp.substr(($fp.rindex(".") // -1) + 1) (elem) %ext {
araraloren/perl6-getopt-advance
…/find-source.p6 :113:
return $filepath.substr(($filepath.rindex('/') // -1) + 1);
azawawi/farabi6
…/perl.js :403:
rindex :1, // - right-to-left substring search
azawawi/farabi6
…/perl6-mode.js :285:
"eager hyper substr index rindex grep map sort join lines hints chmod",
azawawi/perl6-gtk-scintilla
…/lexTests.py :36:
b"ref rename require reset return reverse rewinddir rindex rmdir "
cosimo/perl6-cache-memcached
…/Memcached.pm :224:
# return ($ret.rindex("\x0D\x0A") + 2) == $ret.chars;
gabrielash/p6-net-jupyter
…/Magic.pm :98:
my $from = self.target.substr(0, self.pos).rindex("\n") || 0;
perl6/doc
…/5to6-perlfunc.pod6 :1513:
=head2 rindex
perl6/doc
…/5to6-perlfunc.pod6 :1515:
=item rindex STR, SUBSTR, POSITION
perl6/doc
…/5to6-perlfunc.pod6 :1518:
"babaganush";say $x.rindex("a"); say $x.rindex("a", 3); # 5, 3>. Main
perl6/doc
…/5to6-perlfunc.pod6 :1531:
which exports a C<rindex> function that mimics the original Perl 5 behaviour
perl6/doc
…/traps.pod6 :433:
These same caveats apply to L<.rindex|/type/Str#routine_rindex>.
perl6/doc
…/Cool.pod6 :97:
rindex Str
perl6/doc
…/Cool.pod6 :1321:
=head2 routine rindex
perl6/doc
…/Cool.pod6 :1325:
multi sub rindex(Str(Cool) $haystack, Str(Cool) $needle, Int(Cool) $startpos = $haystack.chars)
perl6/doc
…/Cool.pod6 :1326:
multi method rindex(Str(Cool) $haystack: Str(Cool) $needle, Int(Cool) $startpos = $haystack.chars)
perl6/doc
…/Cool.pod6 :1333:
See L<the documentation in type Str|/type/Str#routine_rindex> for examples.
perl6/doc
…/Str.pod6 :220:
=head2 routine rindex
perl6/doc
…/Str.pod6 :222:
multi sub rindex(Str:D $haystack, Str:D $needle, Int $startpos = $haystack.chars --> Int)
perl6/doc
…/Str.pod6 :223:
multi method rindex(Str:D $haystack: Str:D $needle, Int $startpos = $haystack.chars --> Int)
perl6/doc
…/Str.pod6 :230:
say rindex "Camelia is a butterfly", "a"; # OUTPUT: «11␤»
perl6/doc
…/Str.pod6 :231:
say rindex "Camelia is a butterfly", "a", 10; # OUTPUT: «6␤»
perl6/doc
…/manage-page-order.p6 :161:
my $idx = rindex $line, $FILE;
perl6/doc
…/manage-page-order.p6 :403:
my $idx = rindex $line, '#';
perl6/doc
…/manage-page-order.p6 :424:
my $idx = rindex $line, $type;
perl6/doc
…/words.pws :1012:
rindex
sergot/bamboo
…/bamboo :35:
$dir .= substr(rindex($dir, '/') + 1);
sergot/bamboo
…/bamboo :64:
$module .= substr(0, rindex $module, '.');
sergot/http-useragent
…/http-download.p6 :18:
'index.html' !! $url.substr($url.rindex('/') + 1);
spitsh/spitsh
…/Quote.pm6 :35:
|| { $*sheardoc = $/.pos - $/.orig.substr(0,$/.pos).rindex("\n") - 1 }
spitsh/spitsh
…/Compile-Cmd-And-Call.pm6 :121:
("\\\n$*pad " if $pipe.substr($pipe.rindex("\n") // 0).chars > $!max-chars-per-line),
tony-o/perl6-pluggable
…/Pluggable.pm6 :124:
@files = map(-> $s { $s.substr(0, $s.rindex('.')) }, @files);
tony-o/perl6-xoo
…/Xoos.pm6 :29:
my $mod-name = $f.path.substr($f.index("lib/$base")+4, $f.rindex('.') - $f.index("lib/$base") - 4);
zag/plosurin
…/Plosurin.pm :19:
# RAKUDO workaround for RT #70003, $m.orig.rindex(...) directly fails
zag/plosurin
…/Plosurin.pm :20:
my $column = $m.from - ('' ~ $m.orig).rindex("\n", $m.from);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment