Skip to content

Commit

Permalink
v. 0.4.1, regexanaluzer.js, regexcomposer.js, some features changed, …
Browse files Browse the repository at this point in the history
…minor updates, refactor
  • Loading branch information
Nikos M committed Oct 3, 2014
1 parent 1a66d5f commit 04f5787
Show file tree
Hide file tree
Showing 19 changed files with 1,343 additions and 3,006 deletions.
67 changes: 43 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
regex-analyzer and regex-composer
=================================

* A simple Regular Expression Analyzer for JavaScript / PHP / Python
* A simple and intuitive Regular Expression Composer for JavaScript / PHP / Python
* A simple Regular Expression Analyzer for PHP, Python, Node/JS
* A simple and intuitive Regular Expression Composer for PHP, Python, Node/JS


*PHP / Python implementations in progress*
Expand All @@ -13,7 +13,7 @@ These are used mostly as parts of other projects but uploaded here as standalone
The analyzer needs a couple of extensions but overall works good.


See /test/test.js under /test folder for examples of how to use
See /test/js/test.js under /test folder for examples of how to use


**RegExAnalyzer Live Example:**
Expand All @@ -26,42 +26,61 @@ See /test/test.js under /test folder for examples of how to use
[![Live Example](/test/screenshot2.png)](https://foo123.github.com/examples/regex-composer/)


**RegExComposer Example:** (see /test/test.js)
**RegExComposer Example:** (see /test/js/test.js)

```javascript

// eg. in node

var Composer = require('../build/regexcomposer.js').RegExComposer;
var outregex = new Composer()
var echo = console.log;

echo("Testing Composer");
echo("================");

var Composer = require('../../src/js/regexcomposer.js');
var identifierSubRegex = new Composer( )

.characterGroup( )
.characters( '_' )
.range( 'a', 'z' )
.end( )

.characterGroup( )
.characters( '_' )
.range( 'a', 'z' )
.range( '0', '9' )
.end( )

.zeroOrMore( )

.partial( );

var outregex = new Composer( )

.startOfLine()
.startOfLine( )

.either()
.either( )

.characterGroup(false)
.characters('a', 'b', 'c', '.')
.range('d', 'f')
.end()
.sub( identifierSubRegex )

.match('**aabb**')
.match( '**aabb**' )

.any()
.any( )

.space()
.space( )

.digit(false).oneOrMore()
.digit( false ).oneOrMore( )

.end()
.end( )

.zeroOrMore(false)
.zeroOrMore( false )

.endOfLine()
.endOfLine( )

.compose('i');
.compose( 'i' );

echo("Partial: " + identifierSubRegex);
echo("Composed: " + outregex.toString());
echo("Expected: " + "/^([^abc\\.d-f]|\\*\\*aabb\\*\\*|.|\\s|\\D+)*?$/i");
echo("Expected: " + "/^([_a-z][_a-z0-9]*|\\*\\*aabb\\*\\*|.|\\s|\\D+)*?$/i");
echo("================");
echo();

```

Expand Down
18 changes: 0 additions & 18 deletions build-min.bat

This file was deleted.

18 changes: 0 additions & 18 deletions build-min.sh

This file was deleted.

18 changes: 0 additions & 18 deletions build.bat

This file was deleted.

18 changes: 0 additions & 18 deletions build.sh

This file was deleted.

Loading

0 comments on commit 04f5787

Please sign in to comment.