{"id":25231545,"url":"https://github.com/gaepdit/sqlserverregexfunctions","last_synced_at":"2026-02-23T22:08:39.630Z","repository":{"id":113963736,"uuid":"77227282","full_name":"gaepdit/SqlServerRegexFunctions","owner":"gaepdit","description":"Regular expressions as user-defined functions in SQL Server","archived":false,"fork":false,"pushed_at":"2025-02-27T22:43:34.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T07:16:00.087Z","etag":null,"topics":["regex","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaepdit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-23T13:30:50.000Z","updated_at":"2025-02-27T22:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"219133e2-c390-4cb3-9865-7a53727095e5","html_url":"https://github.com/gaepdit/SqlServerRegexFunctions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaepdit%2FSqlServerRegexFunctions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaepdit%2FSqlServerRegexFunctions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaepdit%2FSqlServerRegexFunctions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaepdit%2FSqlServerRegexFunctions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaepdit","download_url":"https://codeload.github.com/gaepdit/SqlServerRegexFunctions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247355614,"owners_count":20925665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["regex","sql-server"],"created_at":"2025-02-11T12:29:02.630Z","updated_at":"2026-02-23T22:08:39.604Z","avatar_url":"https://github.com/gaepdit.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Regular Expressions (Regex) Functions for SQL Server\n\nAn implementation of .NET Regular Expressions for use in SQL Server. All C# code is based on code from\nthe [Just geeks blog](http://justgeeks.blogspot.com/2008/08/adding-regular-expressions-regex-to-sql.html).\n\nThe SQL script creates T-SQL wrapper functions that call the functions in the CLR assembly.\n\n## Available functions\n\n* **RegexMatch** - returns 1 if pattern can be found in input, else 0\n* **RegexReplace** - replaces all matches in input with a specified string\n* **RegexSelectOne** - returns the first, second, third, etc match that can be found in the input\n* **RegexSelectAll** - returns all matches delimited by separator that can be found in the input\n\n## Usage examples\n\n``` sql\n-- Returns 1 in this case since the phone number pattern is matched\nselect dbo.RegexMatch( N'123-45-6749', N'^\\d{3}-\\d{2}-\\d{4}') \n\n-- Returns 137 since all alpha characters where replaced with no characters\nselect dbo.RegExReplace('Remove1All3Letters7','[a-zA-Z]','') \n\n-- Returns 123-45-6789 since first match was specifed. If last parameter was 1 then the second match (222-33-4444) would be returned.\nselect dbo.RegexSelectOne('123-45-6749xxx222-33-4444', '\\d{3}-\\d{2}-\\d{4}', 0) \n\n-- Returns 123-45-6749|222-33-4444 \nselect dbo.RegexSelectAll('123-45-6749xxx222-33-4444', '\\d{3}-\\d{2}-\\d{4}', '|') \n```\n\n## Installation\n\n1. Build the `RegexFunctions` project in Visual Studio.\n2. In the build output folder, run the \"generate-assembly-script.ps1\" script which generates a \"CreateAssembly.sql\" file.\n3. In SQL Server, run the \"CreateAssembly.sql\" file.\n4. Run the \"SQL Server Objects\\Create UserDefinedFunctions.sql\" script to add the SQL Server wrapper functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaepdit%2Fsqlserverregexfunctions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaepdit%2Fsqlserverregexfunctions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaepdit%2Fsqlserverregexfunctions/lists"}