Skip to content
Advertisement

Tag: regex

Using ‘LIKE’ and ‘REGEXP’ in a SQL query

I’m trying to use some regex on an expression where I have two conditions on the WHERE clause. The pattern I want to capture is 106 followed by any digit followed by a digit that must be either 3 or 4, i.e. 106[0-9][3-4] First, I tried this: This produced an error as below and it would be good to know

SQL/Regex Challenge/Puzzle: How to remove comments from SQL code (by using SQL query)?

Requirements Single-lines comments (e.g. — my comment) should be removed. Multi-line comments (e.g. /* my comment */) should be removed. The content of strings literals (e.g. ‘this is a multi-line comment: /* my comment */’) should be ignored. The content of identifiers (e.g. “– column 1 –“) should be ignored. literals and identifiers Literals and identifiers can span over multiple

Oracle Regular Expression (REGEXP_LIKE) Too Long Error – ORA-12733

I have to validate an IPv6 address in PL/SQL. I came up with the regular expression from here: Regular Expression (RegEx) for IPv6 Separate from IPv4 I am getting an ORA-12733: regular expression too long error. Is there any way around this? The limit is 512 (https://stackoverflow.com/a/2694119/3112803), I’m at 657. I cannot think of any way to split this up.

Access UPDATE query using Regular Expressions

I have created the following Regular expression in javascript to test if the string works. which works perfectly fine. However no i have tried to convert this SQL (using the ms access sample database) i have tried the following which hasn’t worked as i get an error. which didn’t work. I think I’ve gone about the wrong approach to the

Replace Parameters in SQL query text with XXXXX

I m writing a small utility that captures and logs SQL statements, but will have to remove sensitive data from the Query text and replace with with some dummy text (i.e:XXXXX). What is a good way to parse the SQL query in java and replace parameters value? for example: replace with Answer Using JSQLParser (V0.8.9) this is a solution for

Extract SQL statements from Java/SQL files

I have a huge codebase that has a lot of JAVA and .sql files. I intend to extract all the SQL statements from all these files. Here is the way I intend to achieve this – Build a regex file containing patterns like select, insert, delete, update etc that I intend to extract. Parse files line by line in code

Advertisement