Git Product home page Git Product logo

anagrep's Introduction

A Haskell library for matching permutations of regular expressions: http://hackage.haskell.org/package/anagrep

And a command-line interface, useful for puzzle solving (e.g., which English word has one 'p', one 'q', and four vowels?):

Usage: anagrep REGEXP [FILE]...
Print lines in each FILE (or stdin) for which some permutation (anagram)
matches the given REGEXP.  REGEXP is a restricted regular expression that can
contain the following patterns:
  Character matches
    x         single literal character
    [aein-z]  character set (any listed character)
    [^a-mou]  negated character set (any character not listed)
    .         any single character
    \x        escape single literal character (no special meanings)
  Repeat modifiers - may only be applied to characters (above)
    {N,M}     repeat character N-M times
    {N,}      repeat character at least N times
    {N}       equivalent to {N,N}
    ?         equivalent to {0,1}
    *         equivalent to {0,}
    +         equivalent to {1,}
  Combination
    XY        concatenation matches pattern X and Y in either order
    X|Y       alternation matches pattern X or Y
    (X)       grouping (only useful for alternation - note that successive
              grouped alternations involve a cross-product expansion and may
              be slow)
Other regular expression features are not currently supported.  Matching is
always done on entire lines (like grep -x).

Example: anagrep 'pq[aeiou]{4}' /usr/share/dict/words
  > opaque

Flags:
  -b    treat input as raw byte sequence (uses locale encoding by default)
  -i    ignore case distinctions in patterns and data

anagrep's People

Contributors

dylex avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.