Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法从字符串字段中获取正则表达式组?就像是
SELECT REGEX_GROUP(`email`, '^.+@(.+)$', 0) AS email_host FROM test_table;
例如,字段email看起来像'foo@bar',我想通过^.+@(.+)$正则表达式获取最后一部分。
email
'foo@bar'
^.+@(.+)$
PS 实际上正则表达式会更难,电子邮件正则表达式只是一个例子。