background preloader

Regex

Facebook Twitter

Oracle

Syntax. Db2. Trent’s Blog » Exploring Various SQL RegEx Syntax. By trent on 23 Oct in Database, Programming This is part two of my quest to Incorporating Regex into ORM’s and Database Abstractions. My first steps to exploring the option to implement uniform regex support into my own database orm/abstraction is to compare the syntax of the more popular database systems. To do so I will build an sql query where possible to search the body of page contents for ‘bla bla bla..’ in a test database table. MySQL select * from pages where body REGEXP '(bla(\s)?) +' Postgres select * from pages where body ~ '(bla(\s)?) SQL Server SQL Server doesn’t appear to natively support regex without the help of CLR. select * from pages where dbo.RegExMatch( body,'(bla(\s)?)

SQLite SQLite similarly does not natively support Regular Expressions, however SQLite can be extended as well to do so: The REGEXP operator is a special syntax for the regexp() user function. So SQLite recognizes REGEXP, but it is not implemented. Oracle Informix Sybase. JRegexpTester - Welcome. Regular Expression Library. Regular-Expressions.info - Regex Tutorial, Examples and Referenc.