Code Monkey home page Code Monkey logo

asterisk-matcher's Introduction

2003 I added a dynamic regular expression matcher to asterisk,
which has a weird synatx, but otherwise the matcher looked fine.

* a regex must start with "_"
* regex patterns are case-insensitive except characters inside []
* "." matches zero or more characters (as in * in glob)
* character ranges as in [0-9a-zA-Z]
* X,Z,N match 0-9,1-9,2-9 resp.    
* "?" matches any character
* negation as in [^0] ("any char but 0")
               or [^a-z]
* explicit quantifiers as in X{2,4} ("from 2 to 4 digits"),
                           or X{2,}  ("at least 2 digits"),
                           or X{2}   ("exactly 2 digits"),
* regex-style quantifiers like ?, + and * are supported
   by "{}" grouping.
     ? <=> {0,1}
     + <=> {1,}
     * <=> {0,}
* grouping as in N(1X){1,2}  ("one or two sequences of 1X")
* capturing
   with () grouped matches are stored in subsequent numbered global
   variables, starting with $1, $2 and so on.
* alternation as in (01|0|99) ("01 or 0 or 99")
   This is not yet supported, the subsequent alternatives are not
   checked yet.

Copyright 2003 Reini Urban, MIT Licensed.

In the end it was removed from CVS before a release without me
noticing because the variable capturing was not thread-safe. Would
have been trivial to fix.

asterisk-matcher's People

Contributors

rurban avatar

Watchers

 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.