-
-
30 Oct 2020 09:58:39 UTC
- Distribution: Parqus
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (253 / 7 / 0)
- Kwalitee
Bus factor: 1- 94.37% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.69KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Parqus - parse a search query string
VERSION
version 0.05
SYNOPSIS
use Parqus; my $parser = Parqus->new( keywords => [ qw/name title/ ] ); my $res; $res = $parser->process('title:"bar baz" foo title: meh'); # { # words => ['foo'], # keywords => { # title => [ # 'bar baz', # 'meh', # ] # }, # } $res = $parser->process('title:"bar baz" title: meh'); # { # keywords => { # title => [ # 'bar baz', # 'meh', # ] # }, # } $res = $parser->process('foo bar baz'); # { # words => ['foo', 'bar', 'baz'], # } $res = $parser->process('tag: inactive'); # { # errors => { # 'Parse Error: Invalid search query.' # }, # }
DESCRIPTION
Parqus (PArse QUery String) parses a search-engine like string into a perl structure
NEW
my $parser = Parqus->new( %options );
OPTIONS
keywords
keywords => [ qw/name title/ ]
the list of keywords you want to recognise.
value_regex
regular expression to capture words. (default:
[qr![\w-]+!xms]
)string_delimiters
array of characters used to delimit strings. (default:
['"]
)SEE ALSO
Regexp::Grammars, Search::Query, Search::Query::Dialect::DBIxClass
AUTHOR
David Schmidt <davewood@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2020 by David Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Parqus, copy and paste the appropriate command in to your terminal.
cpanm Parqus
perl -MCPAN -e shell install Parqus
For more information on module installation, please visit the detailed CPAN module installation guide.