Myregextester.com is the premier online regular expressions tester that allows visitors to construct, test, and optimize regular expressions.

 Click here to manually set the number of rows for match/replacement textareas. Regex Cheat Sheet Regex Tutorials Regex Book

URL SOURCE:   FILE SOURCE:

MATCH PATTERN:

REPLACEMENT PATTERN:

OPERATION: # # FLAGS: i
x
m
s
 Help SHOW MATCH ARRAY:    EXPLAIN:    SHOW CODE: PHP
ASP
VB.NET
C#.NET
Java
JS
DELIM: HIGHLIGHT MATCHES:      GEN SAMPLES:   
    Save example     Help     FROM: TO: 

PASSWORD RESTRICTIONS:

Allow only these characters:  (any character)  ]
At Least  Total Characters
No More Than   Total Characters
At Least  Lowercase Characters (a-z)
At Least  Uppercase Characters (A-Z)
At Least  Numeric Characters (0-9)
At Least  Special Characters in [^a-zA-Z0-9]  ]
Disallow sequential alphanumeric sequences of or more (i.e. 123... abc... ABC...)
Disallow repeating characters of or more (i.e. 11... aa... AA... %%...)

WORD LIST:



SOURCE TEXT:

HIGHLIGHTED MATCHES:

Select All (to copy etc.)
CAPTURE GROUPS Help
0
 
1

CREATE PROCEDURE dbo.uspGetEmployeesTest2   
    @LastName nvarchar(50),   
    @FirstName nvarchar(50)   
AS   
    SET NOCOUNT ON;  

    SELECT 
        FirstName, LastName, Department  
    FROM 
        HumanResources.vEmployeeDepartmentHistory  
    WHERE 
        FirstName = @FirstName 
        AND LastName = @LastName  
        AND EndDate IS NULL;  
GO  

CREATE PROCEDURE [dbo].[uspGetEmployeesTest2]  
    @LastName nvarchar(50),   
    @FirstName nvarchar(50)   
AS   
    SET NOCOUNT ON;  

    SELECT 
        FirstName, LastName, Department  
    FROM 
        HumanResources.vEmployeeDepartmentHistory  
    WHERE 
        FirstName = @FirstName 
        AND LastName = @LastName  
        AND EndDate IS NULL;  
GO  

RESULTS:

Select All (to copy etc.)
Execution Time(sec.):
0.000009

Raw Match Pattern:
CREATE PROCEDURE (?:dbo|\[dbo\])\.\[*(\w+)\]*

C#.NET Code Example:

using System;
using System.Text.RegularExpressions;
namespace myapp
{
  class Class1
    {
      static void Main(string[] args)
        {
          String sourcestring = "source string to match with pattern";
          Regex re = new Regex(@"CREATE PROCEDURE (?:dbo|\[dbo\])\.\[*(\w+)\]*");
          MatchCollection mc = re.Matches(sourcestring);
          int mIdx=0;
          foreach (Match m in mc)
           {
            for (int gIdx = 0; gIdx < m.Groups.Count; gIdx++)
              {
                Console.WriteLine("[{0}][{1}] = {2}", mIdx, re.GetGroupNames()[gIdx], m.Groups[gIdx].Value);
              }
            mIdx++;
          }
        }
    }
}


$matches Array:
(
    [0] => Array
        (
            [0] => CREATE PROCEDURE dbo.uspGetEmployeesTest2
            [1] => CREATE PROCEDURE [dbo].[uspGetEmployeesTest2]
        )

    [1] => Array
        (
            [0] => uspGetEmployeesTest2
            [1] => uspGetEmployeesTest2
        )

)