ycherkes / OrcaSql

A C# parser for MDF files. Allows you to read tables, metadata and indexes from MDF files without it being attached to a running SQL Server instance.
http://improve.dk/archive/2011/05/03/introducing-orcamdf.aspx
GNU General Public License v3.0
17 stars 7 forks source link

Fix Regex for non-matching user defined datatypes #8

Closed olumideolufy29 closed 1 year ago

olumideolufy29 commented 1 year ago

Regular express

_var match = Regex.Match(typeNameWithoutNull, "(?<=\\w+)\\((\\w+(\\(\\d+\\)*)*)\\)");_

not matching user defined types with underlining datatype with scale and precision

example post(numeric(1,0)) matches numeric(1 instead of numeric(1,0)

Fix is

var match = Regex.Match(typeNameWithoutNull, "(?<=\\w+)\\((\\w+(\\(\\d+(.*)\\)*)*)\\)");

ycherkes commented 1 year ago

@olumideolufy29 I've verified that your fix is working great, thank you!