Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Example Analysis of regular expression in mysql

Shulou Source: shulou.com Published: 2022-05-31 10:54:25 11月13日 Update

This article introduces the knowledge of "case analysis of regular expressions in mysql". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Regular expression is a powerful method to realize complex search. Regular expression describes a set of strings.

The simplest regular expression is an ordinary string. For example, the regular expression hello matches only the string hello.

2. Regular expressions usually contain special structures to match multiple different strings.

For example, the regular expression hello | world contains the replacement operator (|), which can match the string hello or the string world.

Example

The character ^ matches the beginning of the string, for example:

Mysql > SELECT REGEXP_LIKE ('fofo',' ^ fo');-> 1mysql > SELECT REGEXP_LIKE ('tofo',' ^ fo');-> 0

The character $matches the end of the string, for example:

Mysql > SELECT REGEXP_LIKE ('fo\ no','^ fo\ no$');-> 1mysql > SELECT REGEXP_LIKE ('fo\ no','^ fo$');-> 0 this is the end of the regular expression instance Analysis in mysql. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Characters regular expressions strings examples case analysis analysis content more knowledge different complex practical ordinary special learned and then dilemma multiple actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno Apple NVidia MySQL