In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge points about how to use the regexp_instr function in mysql. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
1. The function returns the substring position of the matching pattern pat in the string expr. If no matching substring is found, 0 is returned.
2. If expr or pat is NULL, the function returns NULL. The position of the character starts at 1.
Optional parameters:
Pos means to start the search at the specified location of the string expr. By default, the match starts with the first character.
Occurrence indicates the number of matches returned. By default, the substring position of the first match is returned.
Return_option represents the type of location returned. If the parameter is 0 (the default), the position of the first character of the substring is returned; if the parameter is 1, the position of the first character after the substring is returned.
Match_type represents the way it matches, and the parameters are the same as the REGEXP_LIKE () function above.
Example
Mysql > SELECT REGEXP_INSTR ('dog cat dog',' dog') +-- + | REGEXP_INSTR ('dog cat dog' 'dog') | +-+ | 1 | +-+ mysql > SELECT REGEXP_INSTR (' dog cat dog', 'dog', 2) +-- + | REGEXP_INSTR ('dog cat dog',' dog' 2) | +-- + | 9 | +-- + mysql > SELECT REGEXP_INSTR ('aa aaa aaaa', 'a {2}') +-- + | REGEXP_INSTR ('aa aaa aaaa' 'a {2}') | +-- + | 1 | +-+ mysql > SELECT REGEXP_INSTR ('aa aaa aaaa', 'a {4}') +-- + | REGEXP_INSTR ('aa aaa aaaa' 'a {4}') | +-+ | 8 | +-+ above is all the content of the article "how to use regexp_instr functions in mysql" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.