Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Parse::RandGen::Regexp 0.202

    Download button

    No screenshots available
    Downloads: 365  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jeff Dutton | More programs
    Perl Artistic License / FREE
    December 19th, 2006, 19:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Parse::RandGen::Regexp description

    Parse::RandGen::Regexp is a Perl module for regular expression Condition element.

    Parse::RandGen::Regexp is a Perl module for regular expression Condition element.

    Regexp is a Condition element that matches the given compiled regular expression. For picking random data, the regular expression is parsed into its component Subrules, Literals, CharClasses, etc.... Therefore, the pick functionality for a regular expression is ultimately the same as the pick functionality of a Rule (including the limitations w/r to greediness - see Rule).

    Regexp is also useful as a standalone class. It supports captures (named and indexed), which can be referenced in a call to the pick() function to force the captures to match the specified data, while leaving the rest of the data to be generated randomly.

    METHODS

    new

    Creates a new Regexp. The first argument (required) is the regular expression element (e.g. qr/foo(bar|baz)+d{1,10}/). All other arguments are named pairs.

    element

    Returns the Regexp element (i.e. the compiled regular expression itself).

    numCaptures

    Returns the number of captures (e.g. $1, $2, ...$n) in the regular expression.

    nameCapture

    Give names to capture numbers for the regular expression. The arguments to this function are capture# => "name" pairs (e.g. nameCapture(1=>"directory", 2=>"file", 3=>"extension")).

    capture

    Returns the Rule object that represents the specified capture. The capture can be specified by number or by name (the name is set by the nameCapture() function).

    pick

    Randomly generate data (text) that matches (or does not) this regular expression.
    Takes a "match" boolean argument that specifies whether to match the regular expression or deliberately not match it.

    Also takes a "captures" hash argument that has pairs of capture numbers (or names) and their desired value. This allows the generated data to have user-specified constraints while allowing the rest of the regular expression to choose random data. If "match" is false, the user-specified "captures" values are still used (which may cause the data to match even though it was not supposed to).

    Example:
    $re->pick(match=>1,
    captures=>{ 1=>"http", 2=>"www", 3=>"yahoo", 4=>"com" });

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    regular expression | Condition element | Perl module | Parse::RandGen::Rege | regular | expression

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM