In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you how to use regular expressions to solve binary equations, I believe that most people do not know much, so share this article for your reference, I hope you will learn a lot after reading this article. Let's take a look at it!
I really calculated the result according to the regularity written in the original text. Example on php:
Let me explain.
Let's put it in a simple formula: 2x+3y=9
Principle:
Generate such a rule in this function
^ (. *)\ 1 {1} (. *)\ 2 {2} $
To match a repeating string "-" of length 9, and match the length of the two groups, which is the value of his x and y.
Regular explanation:
[(. *)] that is, 0 to countless [.] periods.
\ 1 is to quote a group. The following [{1}] is repeated once.
The second half is\ 2, which is to quote 2 groups. The following [{2}] is repeated once.
The following is the translation of the English blog:
The binary equation 17x + 12y = 51, its expression [^ (. *)\ 1 {16} (. *)\ 2 {11} $]. It's easy to understand. [(. *)] that is, 0 to countless [.] periods. (here is what I said above. In fact, the [.] dot is meant to represent the character "1".)
That is, 0 to countless 1s, which will be referenced once in [\ 1]. Then [{16}] is 16 times. Acts on the previous [\ 1], that is, 16 references. Plus the initial [(. *)], there are exactly 17 times. I won't talk about the last one, just like this one.
The regular engine tries to add 0 to countless characters "1", 0 characters "1", 1 character "1", and 2 characters "1" in [(. *)]. Until successful, try the maximum number of all characters "1" (51 characters "1" in this case).
The above is all the content of the article "how to use regular expressions to solve binary equations". 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.