Skip to content

Tag: regex

Filter out records that are not in this date format oracle

How do i filter records that can only be converted to date using to_date(’31-May-2019 00:00:00′, ‘DD-MON-YYYY HH24:MI:SS’) from the above sample query i am expecting results below how do i achieve this in oracle. Reason why i want to do this: i am receiving raw data and loading it to a…

Oracle SQL regexp_substr number extraction behavior

In a sense I’ve answered my own question, but I’m trying to understand the answer better: When using regexp_substr (in oracle) to extract the first occurrence of a number (either single or multi digits), how/why do the modifiers * and + impact the results? Why does + provide the behavior I’m…

Regex to match duplicate/alias e-mails in MySQL

I am trying to come up with some regular expression to check whether an e-mail exists in a database. What is more specific here is that I want to find e-mails that are the same, but might be written differently. E.g. john.doe@example.com is the same as johndode+123@example.com and j.o.h.n.d.o.e@example.com. U…

Django Reverse Regex Match

I have a table (Django Model) and each row/object contains a regular expression that I should evaluate over a given input to filter relevant objects. Is there any Django ORM method to do this? In Postgre it will be: and the opposite of what I am searching for is: I know that evaluating the regular expressions…

SQL Query with REGEXP to change URL strings dynamically

My DB table named “post” does look as follows So not every message row does contain an url and not every message with a [LINK]-tag does contain a proper url. Also there are enrties which have a longer ID, they should not be changed. Now i have to change every entry which has an ID length between 4…