Skip to content

Commit

Permalink
regex-analyzer.js 0.4.2 (get compiled regular expression getRegex met…
Browse files Browse the repository at this point in the history
…hod)
  • Loading branch information
Nikos M committed Oct 4, 2014
1 parent 04f5787 commit 451c9ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/js/regexanalyzer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
*
* RegExAnalyzer
* @version: 0.4.1
* @version: 0.4.2
*
* A simple Regular Expression Analyzer for PHP, Python, Node/JS
* https://github.com/foo123/regex-analyzer
Expand Down Expand Up @@ -34,9 +34,9 @@

"use strict";
/* main code starts here */
var __version__ = "0.4.1",
var __version__ = "0.4.2",

Obj = Object, Arr = Array, to_string = Obj.prototype.toString,
Obj = Object, Arr = Array, Keys = Obj.keys, to_string = Obj.prototype.toString,

escapeChar = '\\',
repeatsRegex = /^\{\s*(\d+)\s*,?\s*(\d+)?\s*\}/,
Expand Down Expand Up @@ -1092,6 +1092,10 @@
return self;
},

getRegex: function( ) {
return new RegExp(this.$regex, Keys(this.$flags).join(''));
},

getParts: function( ) {
var self = this;
if ( self.$needsRefresh ) self.analyze( );
Expand Down
Loading

0 comments on commit 451c9ce

Please sign in to comment.