Found 4 relevant articles
-
Implementing Capture Group Functionality in Go Regular Expressions
This article provides an in-depth exploration of implementing capture group functionality in Go's regular expressions, focusing on the use of (?P<name>pattern) syntax for defining named capture groups and accessing captured results through SubexpNames() and SubexpIndex() methods. It details expression rewriting strategies when migrating from PCRE-compatible languages like Ruby to Go's RE2 engine, offering complete code examples and performance optimization recommendations to help developers efficiently handle common scenarios such as date parsing.
-
Precise Methods for Matching Empty Strings with Regex: An In-Depth Analysis from ^$ to \A\Z
This article explores precise methods for matching empty strings in regular expressions, focusing on the limitations of common patterns like ^$ and \A\Z. By explaining the workings of regex engines, particularly the distinction between string boundaries and line boundaries, it reveals why ^$ matches strings containing newlines and why \A\Z might match \n in some cases. The article introduces negative lookahead assertions like ^(?!\s\S) as a more accurate solution and provides code examples in multiple languages to help readers deeply understand the core mechanisms of regex in handling empty strings.
-
Precise Branch and Tag Control in GitLab CI Using Regular Expressions and Rules Engine
This paper provides an in-depth analysis of techniques for precisely controlling CI/CD pipeline triggers for specific branches and tags in GitLab. By examining the comparative applications of regular expression matching mechanisms and GitLab's rules engine, it details how to configure the only field using regular expressions to match specific tag formats like dev_1.0, dev_1.1, while avoiding incorrect matches such as dev1.2. The article also introduces the more flexible application of rules, including conditional judgments using CI_COMMIT_BRANCH and CI_COMMIT_TAG environment variables, offering developers a complete solution from basic to advanced levels.
-
Using Regular Expressions in SQL Server: Practical Alternatives with LIKE Operator
This article explores methods for handling regular expression-like pattern matching in SQL Server, focusing on the LIKE operator as a native alternative. Based on Stack Overflow Q&A data, it explains the limitations of native RegEx support in SQL Server and provides code examples using the LIKE operator to simulate given RegEx patterns. It also references the introduction of RegEx functions in SQL Server 2025, discusses performance issues, compares the pros and cons of LIKE and RegEx, and offers best practices for efficient string operations in real-world scenarios.