Can a regular expression be used inside a stored procedure? If it can, how? Can you give some examples of how to do it?
Regular expressions are a concise and flexible notation for finding and replacing patterns of text. A specific set of regular expressions can be used in the Find what field of the SQL Server Management Studio Find and Replace dialog box.
The Regular Expressions in PostgreSQL are implemented using the TILDE (~) operator and uses '. *” as a wildcard operator. As you can see in the figure above, we have used Regular Expression in PostgreSQL using the TILDE (~) operator and the wildcard '.
$ means "Match the end of the string" (the position after the last character in the string). Both are called anchors and ensure that the entire string is matched instead of just a substring.
Generally, yes.
MySQL: http://dev.mysql.com/doc/refman/5.1/en/regexp.html
Oracle: http://www.oracle.com/technology/obe/obe10gdb/develop/regexp/regexp.htm
MS SQL: http://msdn.microsoft.com/en-us/magazine/cc163473.aspx
Some more:
PostgreSQL: http://www.postgresql.org/docs/8.3/static/functions-matching.html
DB2: http://www.ibm.com/developerworks/data/library/techarticle/0301stolze/0301stolze.html
Informix: http://www.ibm.com/developerworks/data/zones/informix/library/techarticle/db_regexp.html
SQL Anywhere: http://iablog.sybase.com/paulley/2009/06/using-regular-expressions-with-sql-anywhere/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With