python mode => ^(?=.\bABDUL\b)(?=.\bHAI\b.)(?=.\bMANSOOR\b).* $
Need equivalent mysql schema
Can you help me?
P粉3149159222023-09-08 00:58:02
The regex in the question is a weird way to match simple words. It's not clear what the expected input is. Perhaps, input can justify this approach.
^(?=.\bABDUL\b)(?=.\bHAI\b.)(?=.\bMANSOOR\b).*$
This means: the beginning must be any character that is not a word, followed by ABDUL, a non-word character, HAI, a non-word character, MANSOOR, a non-word character or the end of the string.
^[^[:alnum:]]ABDUL[^[:alnum:]]HAI[^[:alnum:]]MANSOOR([^[:alnum:]]?.*)?$
This means: the beginning is not a number or alphanumeric character (alphanumeric character), ABDUL, a non-alphanumeric character, HAI, a non-alphanumeric character, MANSOOR, a non-alphanumeric character or the end of the string.
I haven't tested it and have no intention of making it exactly the same as the first one, but it should be close enough.
For anyone who wants to copy this into their code:
!ABDUL$HAI)MANSOOR
- make sure this is what you want. For those who want to understand the regular expressions I use, you can refer to the following link:
https://dev.mysql.com/doc/refman/8.0/en/regexp.html (POSIX syntax for mysql) and https://docs.python.org/ 3/library/re.html (PCRE for python = Perl compatible syntax)