Skip to content

infrared/perl-Text-Optional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-Optional

Why

Initial reason for this module was to parse Cisco IOS command line syntax for quiz purposes.

Given:

conf(igure) t(erminal)

The text enclosed by parentheses is optional, and any sequence of optional text will return true.

For the above example, the following tests will return true:

conf t
confi term
configure t
conf terminal

and so on..

Syntax

use Text::Optional;
my $ob = Text::Optional->new;
 
my $valid = 'conf(igure) t(erminal)';
my $test  = 'conf ter';
  
$ob->check($valid, $test) ? print  "yup" : print "nope";

About

match text given optional text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages