[Freeswitch-svn] [commit] r5475 - freeswitch/trunk/scripts/contrib/trixter

Freeswitch SVN trixter at freeswitch.org
Tue Jun 26 17:19:24 EDT 2007


Author: trixter
Date: Tue Jun 26 17:19:24 2007
New Revision: 5475

Added:
   freeswitch/trunk/scripts/contrib/trixter/regexptest.pl   (contents, props changed)

Log:
added a simple commandline perl regexp tester, useful for testing those wacky dialplan regexps


Added: freeswitch/trunk/scripts/contrib/trixter/regexptest.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/regexptest.pl	Tue Jun 26 17:19:24 2007
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+# -*- mode:cperl; tab-width:4; c-basic-offset:4; c-indent-level:4; indent-tabs-mode:nil;  -*-
+
+
+print "Enter the regexp you wish to test: ";
+$regexp = <STDIN>;
+chomp($regexp);
+
+print "Enter the value you wish to test: ";
+$value = <STDIN>;
+chomp($value);
+
+if ($value =~ m/$regexp/) {
+  print "Regexp matches\n";
+  $x=1;
+  while (defined $$x) {
+    print "capture $x: $$x\n";
+    $x++;
+  }
+}



More information about the Freeswitch-svn mailing list