In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you the "regular expression how to achieve the minimum matching function", the content is easy to understand, clear, hope to help you solve the doubt, the following let the editor lead you to study and learn "regular expression how to achieve the minimum matching function" this article.
The details are as follows:
Regular expressions achieve maximum matching by default, which is very undesirable in some cases, such as the following code:
# starting IndiaInventoryAPP.exe "~ ~ DisplayVariableValues" parameterGroup,mailRecipients,ModuleArgs "~ DisplayVariableValues" LogFolder "~ $binaryExitCode = 0~~$IndiaInventoryArgs ="-asWin32Console-S HKDRMSUAT3-D $DatabaseName-U $DatabaseUserName-P $DatabasePassword-L $LogFolder-MailRecipients $mailRecipients-T $today_yyyy-Z D:\ cs48516\ posIds.txt "~ ExecuteBinaryCommand ([ref] $binaryExitCode)" $applicationPath/IndiaInventoryAPP.exe "$IndiaInventoryArgs $true~
We want to match any text between # and ~, and the way to achieve minimum matching is to use (? I)
Here are the specific implementation methods:
String commentGrammer = @ "(? I)\ #. *? ~"; Regex commentRegex = new Regex (commentGrammer,RegexOptions.IgnoreCase | RegexOptions.Singleline); MatchCollection commentMC = commentRegex.Matches (input); foreach (Match match in commentMC) {int length = match.Length; int index = match.Index; richTextBox.Select (index, length); richTextBox.SelectionColor = Color.Green;} above is all the content of the article "how regular expressions achieve minimum matching". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.