- Notifications
You must be signed in to change notification settings - Fork0
trapd00r/File-PatternMatch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Every tiny cent helps a lot!
File::PatternMatch - parse media information from filenames
use File::PatternMatch;my @files = glob("$ENV{HOME}/music/*");my $plain = patternmatch(@files);my $extended_colors = patternmatch(256, @files);
File::PatternMatch takes a list of filenames and tries to parse relevantinformation from them. If a filename contains the string 'S01E01' we can safelyassume it's a new TV show, the first episode from the first season, and thus welabel it 'New Show'.
There are filters for various music genres, tv shows and music videos.
The labels can be formatted in three ways (output formats):
Raw, plain text.
Colored using extended escape sequences (seeTerm::ExtendedColor).
Formatted using thedzen2(1) notation.
Parameters: $output_format, @files
Returns: \%results
patternmatch() takes a list of filenames and tries to match them aginstspecific patterns. The result might look like:
# Plain text2 => { 'Prison.Break.S01E01-FOOBAR' => 'New Show',},42 => { 'Laleh-Prinsessor-FOOBAZ' => 'Pop/Rock',},# Using extended color escape sequences2 => { 'Prison.Break.S01E01-FOOBAR' => "\e[38;5;160mNew Show\e[0m",},# Using dzen2 format2 => { 'Prison.Break.S01E01-FOOBAR' => '^fg(#ff0000)New Show^fg()',},
https://github.com/trapd00r/rel
Magnus WoldrichCPAN ID: WOLDRICHm@japh.sehttp://japh.se
Report bugs and/or feature requests:
https://github.com/trapd00r/Foo-Bar/issues
Copyright 2011, 2018- Magnus Woldrichm@japh.se. This program is freesoftware; you may redistribute it and/or modify it under the same terms asPerl itself.