{"id":306,"date":"2019-06-22T18:00:50","date_gmt":"2019-06-22T18:00:50","guid":{"rendered":"https:\/\/datablog.roman-halliday.com\/?p=306"},"modified":"2024-10-09T06:21:55","modified_gmt":"2024-10-09T06:21:55","slug":"querying-sql-server-with-something-like-a-regular-expression","status":"publish","type":"post","link":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/","title":{"rendered":"Querying SQL Server with something LIKE a regular expression"},"content":{"rendered":"\n<p>Most of us are familiar with the <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/language-elements\/like-transact-sql?view=sql-server-2017\">LIKE<\/a> command in SQL Server (and other DBMS environments), but few venture beyond simple text matching and the &#8216;%&#8217; wildcard. It&#8217;s ability to use some regular expression (a.k.a. regex or regexp) syntax is a surprise to many.<\/p>\n\n\n\n<p>For this article, I&#8217;m assuming that readers have already used the LIKE statement a few times and the first example is almost patronising.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Text Substring Matches<\/h2>\n\n\n\n<p>Let&#8217;s start with what most people use, a simple text substring match. Using the &#8216;%&#8217; to say &#8220;and anything else&#8221;&#8230; <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">WITH sample_data AS (\nSELECT 1   AS [id], 'abc' AS [val] UNION ALL\nSELECT 2   AS [id], 'ABC' AS [val] UNION ALL\nSELECT 3   AS [id], 'xyz' AS [val] UNION ALL\nSELECT 4   AS [id], 'XYZ' AS [val] UNION ALL\nSELECT 5   AS [id], '123' AS [val] UNION ALL\nSELECT 5   AS [id], '1T3' AS [val]\n)\nSELECT *\n  FROM sample_data\n WHERE [val] LIKE 'ab%'\n;<\/pre>\n\n\n\n<p>Which gives us the below output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">| id  | val |\n| 1   | abc |\n| 2   | ABC |<\/pre>\n\n\n\n<p>While powerful (and the most used feature of LIKE), this just the tip of the iceberg. It&#8217;s also a perfect example of where the syntax of the LIKE command is different from the equivalent regular expression.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Regular Expressions<\/h2>\n\n\n\n<p>Some people will read &#8220;regular expression&#8221; and react with a knowing nod (feel free to jump ahead), everyone else is about to learn something you never realised you needed to know. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is a Regular Expression?<\/h3>\n\n\n\n<p>A regular Expression is a string which represents a pattern for matching. There are many cases where there is a pattern which we want to test text against. A common example is if a date is formatted as a process expects it (YYYY-MM-DD or DD\/MM\/YY etc&#8230;).<\/p>\n\n\n\n<p>A more advanced case is validating an email address, very quickly you can build up rules in your head (it has to have the &#8216;@&#8217;, but only once, and there has to be something either side of it&#8230;. and so on)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What do they do in SQL Server?<\/h3>\n\n\n\n<p>The common one we have all seen is shown in the first bit of code at the top, &#8216;ab%&#8217; (the letter &#8216;a&#8217; followed immediately by the letter &#8216;b&#8217; then &#8220;anything else&#8221;). The syntax of a regular expression allows us to build more complicated rules, such as &#8216;a&#8217; or &#8216;b&#8217;, followed by a number (less than 5), and then any letter.<\/p>\n\n\n\n<p>For illustrative purposes, here is a sample of the two expressions mentioned above (don&#8217;t worry about understanding them just yet).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>--the letter 'a' followed immediately by the letter 'b' then \"anything else\"\n   AND [val] LIKE 'ab%'\n\n--'a' or 'b', followed by a number (less than 5), and then any letter.\n   AND [val] LIKE '[ab][0-4][a-z]'<\/code><\/pre>\n\n\n\n<p>I&#8217;ve put some links to documentation on regular expressions at the bottom. I believe they are something that every developer should have a basic understanding of. Just keep in mind the syntax in SQL Server is a little different (and cut down) than most other languages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Regular Expressions in SQL Server<\/h2>\n\n\n\n<p>Now we know what a regular expression is, it&#8217;s time to look at the syntax. There are only 4 sets of wild card characters used in the LIKE statement, but combined they are very powerful.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>%<\/code> &#8211; Anything, any number of times.<\/li><li><code>_<\/code> (underscore) &#8211; Anything, but once.<\/li><li><code>[]<\/code> &#8211; Any one of the characters within the square brackets (note, a range can be used such as 0-9 for numbers).<\/li><li><code>[^]<\/code> &#8211; Any character <em>not <\/em>within the square brackets (note, a range can be used such as 0-9 for numbers).<\/li><\/ul>\n\n\n\n<p>We are already familiar with the %, as it&#8217;s well used. <\/p>\n\n\n\n<p>The use of the underscore is just the same, except it matches just one character. So <code>'a_c'<\/code> matches &#8216;abc&#8217; and &#8216;a1c&#8217; but <em>not <\/em>&#8216;abbc&#8217; (which would be matched by <code>'a%c'<\/code>).<\/p>\n\n\n\n<p>It&#8217;s easy to think of the square brackets as an extension of the underscore. Rather than saying one of any character, we are saying one character from a list. For example <code>'a[bt]c'<\/code> matches &#8216;abc&#8217; and &#8216;atc&#8217;, but now it won&#8217;t match &#8216;a1c&#8217; or &#8216;abbc&#8217;. Common ranges used in this are numbers such as <code>[0-9]<\/code> and letters<code> [a-z]<\/code>.<\/p>\n\n\n\n<p>Lastly, using the <code>[^]<\/code> syntax allows for a negation. Changing our previous example to  <code>'a[^bt]c'<\/code>  no longer matches &#8216;abc&#8217; and &#8216;atc&#8217;, but <em>does <\/em>match &#8216;a1c&#8217; (1 isn&#8217;t b or t). Keep in mind, &#8216;abbc&#8217; or  &#8216;a11c&#8217; still won&#8217;t match (it has too many letters).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Examples<\/h3>\n\n\n\n<p>Below is some code which will buts the above examples into practise (just comment\/uncomment the lines to see each filter, or play with it over at <a href=\"https:\/\/rextester.com\/FES89921\">rextester.com: SQL Server &#8211; regex filtering using LIKE<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">WITH sample_data AS (\nSELECT 0   AS [id], '123'  AS [val] UNION ALL\nSELECT 1   AS [id], 'abc'  AS [val] UNION ALL\nSELECT 2   AS [id], 'atc'  AS [val] UNION ALL\nSELECT 3   AS [id], 'a1c'  AS [val] UNION ALL\nSELECT 4   AS [id], 'abbc' AS [val] UNION ALL\nSELECT 5   AS [id], 'a11c' AS [val]\n)\nSELECT *\n  FROM sample_data\n WHERE 1=1\n --AND [val] LIKE 'ab%'\n --AND [val] LIKE 'a%c'\n --AND [val] LIKE 'a_c'\n --AND [val] LIKE 'a[bt]c'\n --AND [val] LIKE 'a[^bt]c'\n;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">More Ways of Using Regular Expressions<\/h2>\n\n\n\n<p>All these can be seen and tried over at rextester.com: <a href=\"https:\/\/rextester.com\/BPN30745\">SQL Server &#8211; regex examples<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Checking for a date<\/h3>\n\n\n\n<p>This comes in handy when working with data which needs cleaning, or if a text field is a free form field which happens (in some cases) to contain a relevant date&#8230; Say what you will about good\/bad practise, I&#8217;ve seen this sort of issue in more than one place.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">WITH sample_data AS (\nSELECT 1  AS [id], '2019-01-01' AS [val] UNION ALL -- Normal Valid\nSELECT 2  AS [id], '2019-01-02' AS [val] UNION ALL -- Normal Valid\nSELECT 3  AS [id], '1998-01-03' AS [val] UNION ALL -- Normal Valid\nSELECT 4  AS [id], 'BROKEN'     AS [val] UNION ALL -- Text\nSELECT 5  AS [id], '1800-01-01' AS [val] UNION ALL -- Outside our date range\nSELECT 6  AS [id], '01-06-2019' AS [val] UNION ALL -- Wrong Format\nSELECT 7  AS [id], '2019-31-01' AS [val]           -- Month\/Day clearly in wrong order\n)\nSELECT *\n  FROM sample_data\nWHERE 1=1\n   AND [val] LIKE '[1-2][09][0-9][0-9]-[01][0-9]-[0-3][0-9]'\n;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Looking for a literal wildcard character<\/h3>\n\n\n\n<p>To find a literal character which is one of the wild cards (for example &#8216;%&#8217;), just place it between the square brackets and it becomes a literal. Such as <code>'[_]'<\/code>, with the exception of <code>']'<\/code> which can be treated as any other character.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">WITH sample_data AS (\nSELECT 1  AS [id], 'a[cxyz' AS [val] UNION ALL\nSELECT 2  AS [id], 'ABCX]Z' AS [val] UNION ALL\nSELECT 3  AS [id], 'xyzabc' AS [val] UNION ALL\nSELECT 4  AS [id], 'XY%ABC' AS [val] UNION ALL\nSELECT 5  AS [id], 'ABC123' AS [val] UNION ALL\nSELECT 6  AS [id], '123XYZ' AS [val] UNION ALL\nSELECT 7  AS [id], '123456' AS [val] UNION ALL\nSELECT 8  AS [id], '123%Y6' AS [val] UNION ALL\nSELECT 9  AS [id], '123_67' AS [val]\n)\nSELECT *\n  FROM sample_data\n WHERE 1=1\n   AND(   [val] LIKE '%[%]%'\n       OR [val] LIKE '%[_]%'\n       OR [val] LIKE '%[[]%'\n       OR [val] LIKE '%]%'\n      )\n;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Further Reading<\/h2>\n\n\n\n<p>The documentation from Microsoft covers the <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/language-elements\/like-transact-sql?view=sql-server-2017\">LIKE<\/a> statement in depth and is a good place to look into this further.<\/p>\n\n\n\n<p>If regular expressions are new to you, or you haven&#8217;t seen much more than the above, now is a time to learn more! Many developers will go on and encounter regular expressions in many other environments. From using shell commands in a unix system (sed for example), in other programming languages, and in big data interfaces (hadoop, built on java manages to leverage the full power of regular expressions). <\/p>\n\n\n\n<p>So, make a bit of time, pour a nice cup of coffee and read (thanks to the web archive): <a href=\"https:\/\/web.archive.org\/web\/20100611221311\/http:\/\/immike.net\/blog\/2007\/04\/06\/the-absolute-bare-minimum-every-programmer-should-know-about-regular-expressions\/\">The absolute bare minimum every programmer should know about regular expressions<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Online Tools<\/h3>\n\n\n\n<p>I found this interactive site, very useful for testing regular expressions (although it goes beyond the SQL Server syntax):  <a href=\"https:\/\/regexr.com\/\">https:\/\/regexr.com\/<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of us are familiar with the LIKE command in SQL Server (and other DBMS environments), but few venture beyond simple text matching and the &#8216;%&#8217; wildcard. It&#8217;s ability to use some regular expression (a.k.a. regex or regexp) syntax is a surprise to many. For this article, I&#8217;m assuming that readers have already used the&hellip;<\/p>\n<p class=\"read-more\"><a class=\"readmore-btn\" href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/\">Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[25,7],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-databases","category-sql-server","tag-regex","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Querying SQL Server with something LIKE a regular expression - Rows Across The Lake<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Querying SQL Server with something LIKE a regular expression - Rows Across The Lake\" \/>\n<meta property=\"og:description\" content=\"Most of us are familiar with the LIKE command in SQL Server (and other DBMS environments), but few venture beyond simple text matching and the &#8216;%&#8217; wildcard. It&#8217;s ability to use some regular expression (a.k.a. regex or regexp) syntax is a surprise to many. For this article, I&#8217;m assuming that readers have already used the&hellip;Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/\" \/>\n<meta property=\"og:site_name\" content=\"Rows Across The Lake\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-22T18:00:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-09T06:21:55+00:00\" \/>\n<meta name=\"author\" content=\"david\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@d_roman_h\" \/>\n<meta name=\"twitter:site\" content=\"@d_roman_h\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"david\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/\"},\"author\":{\"name\":\"david\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"headline\":\"Querying SQL Server with something LIKE a regular expression\",\"datePublished\":\"2019-06-22T18:00:50+00:00\",\"dateModified\":\"2024-10-09T06:21:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/\"},\"wordCount\":946,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"keywords\":[\"regex\",\"SQL\"],\"articleSection\":[\"Databases\",\"SQL Server\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/\",\"url\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/\",\"name\":\"Querying SQL Server with something LIKE a regular expression - Rows Across The Lake\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#website\"},\"datePublished\":\"2019-06-22T18:00:50+00:00\",\"dateModified\":\"2024-10-09T06:21:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/index.php\\\/2019\\\/06\\\/22\\\/querying-sql-server-with-something-like-a-regular-expression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Querying SQL Server with something LIKE a regular expression\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#website\",\"url\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/\",\"name\":\"Rows Across The Lake\",\"description\":\"Data &amp; Databases\",\"publisher\":{\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/datablog.roman-halliday.com\\\/#\\\/schema\\\/person\\\/575f96d2590c3085923ff9e1b565748b\",\"name\":\"david\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\",\"caption\":\"david\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Querying SQL Server with something LIKE a regular expression - Rows Across The Lake","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/","og_locale":"en_GB","og_type":"article","og_title":"Querying SQL Server with something LIKE a regular expression - Rows Across The Lake","og_description":"Most of us are familiar with the LIKE command in SQL Server (and other DBMS environments), but few venture beyond simple text matching and the &#8216;%&#8217; wildcard. It&#8217;s ability to use some regular expression (a.k.a. regex or regexp) syntax is a surprise to many. For this article, I&#8217;m assuming that readers have already used the&hellip;Read More Read More","og_url":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/","og_site_name":"Rows Across The Lake","article_published_time":"2019-06-22T18:00:50+00:00","article_modified_time":"2024-10-09T06:21:55+00:00","author":"david","twitter_card":"summary_large_image","twitter_creator":"@d_roman_h","twitter_site":"@d_roman_h","twitter_misc":{"Written by":"david","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/#article","isPartOf":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/"},"author":{"name":"david","@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"headline":"Querying SQL Server with something LIKE a regular expression","datePublished":"2019-06-22T18:00:50+00:00","dateModified":"2024-10-09T06:21:55+00:00","mainEntityOfPage":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/"},"wordCount":946,"commentCount":1,"publisher":{"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"keywords":["regex","SQL"],"articleSection":["Databases","SQL Server"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/","url":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/","name":"Querying SQL Server with something LIKE a regular expression - Rows Across The Lake","isPartOf":{"@id":"https:\/\/datablog.roman-halliday.com\/#website"},"datePublished":"2019-06-22T18:00:50+00:00","dateModified":"2024-10-09T06:21:55+00:00","breadcrumb":{"@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/datablog.roman-halliday.com\/index.php\/2019\/06\/22\/querying-sql-server-with-something-like-a-regular-expression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/datablog.roman-halliday.com\/"},{"@type":"ListItem","position":2,"name":"Querying SQL Server with something LIKE a regular expression"}]},{"@type":"WebSite","@id":"https:\/\/datablog.roman-halliday.com\/#website","url":"https:\/\/datablog.roman-halliday.com\/","name":"Rows Across The Lake","description":"Data &amp; Databases","publisher":{"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/datablog.roman-halliday.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/datablog.roman-halliday.com\/#\/schema\/person\/575f96d2590c3085923ff9e1b565748b","name":"david","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g","caption":"david"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/acddbc676a1d5c73795edcf0627ee39e5aa947da9033b58373e03d93122cb3b7?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":8,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/posts\/306\/revisions\/637"}],"wp:attachment":[{"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datablog.roman-halliday.com\/index.php\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}