In MySQL Regular Expression pattern matching function, there is a ‘match_type’ – ‘n’.
Which represents,
The . character matches line terminators. The default is for . matching to stop at the end of a line.
Could someone explain me how to use that match type?
Source:
- MySQL: https://dev.mysql.com/doc/refman/8.3/en/regexp.html#function_regexp-like
- oracle: https://docs.oracle.com/cd/B13789_01/server.101/b10759/conditions018.htm
I did not found such example those documentation.
2
Answers
Describe all details in the documentation:
https://medium.com/@artbindu/how-to-use-regex-in-mysql-5ab60a43a883
It’s not clear what you are asking, but here’s an example of how to use match_type n and the effect it has:
This produces no results, because
.
does not match a newline:This produces a result, by specifying match_type
n
to cause.
to match a newline:fiddle
The documentation is poorly worded here; it seems to be assuming a
.*
, but the match_type applies to any.
.