From 1b13f8894e95222580567fdf24a98cf9f39e7c63 Mon Sep 17 00:00:00 2001 From: Michael Giagnocavo Date: Wed, 29 Jul 2009 19:15:00 +0000 Subject: [PATCH] Properly shortcircuit regex git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14417 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../languages/mod_managed/managed/examples/easyroute/App.config | 2 +- .../mod_managed/managed/examples/easyroute/easyroute.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/languages/mod_managed/managed/examples/easyroute/App.config b/src/mod/languages/mod_managed/managed/examples/easyroute/App.config index b2310e2f81..1611fce43c 100644 --- a/src/mod/languages/mod_managed/managed/examples/easyroute/App.config +++ b/src/mod/languages/mod_managed/managed/examples/easyroute/App.config @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/src/mod/languages/mod_managed/managed/examples/easyroute/easyroute.fs b/src/mod/languages/mod_managed/managed/examples/easyroute/easyroute.fs index 3779190b17..4798e1e575 100644 --- a/src/mod/languages/mod_managed/managed/examples/easyroute/easyroute.fs +++ b/src/mod/languages/mod_managed/managed/examples/easyroute/easyroute.fs @@ -48,7 +48,7 @@ module easyroute = let regexOpts = Text.RegularExpressions.RegexOptions.Compiled ||| Text.RegularExpressions.RegexOptions.CultureInvariant let lookup (number: string) sep = try - let number = if numberRegexFilter = "" then number else Text.RegularExpressions.Regex.Replace(number, numberRegexFilter, "", regexOpts) + let number = if numberRegexFilter = "(?!.)" then number else Text.RegularExpressions.Regex.Replace(number, numberRegexFilter, "", regexOpts) use conn = new Odbc.OdbcConnection(connString) use comm = new Odbc.OdbcCommand(query, conn) comm.Parameters.AddWithValue("@number", number) |> ignore