Questions tagged [mysql-regexp]

15 questions
7
votes
3 answers

Use SQL REGEXP (mariadb) for filter in where with special characters in Laravel

mariadb version 10.4 $query->where('column', 'REGEXP', '[[:<:]]'.$string.'[[:>:]]'); This query provides a search with whole words only and that's working fine without special characters. Example Searching row: foo (bar baz) Filter: $string =…
mare96
  • 3,749
  • 1
  • 16
  • 28
1
vote
1 answer

Using MySQL REGEXP to filter string with Django ORM

I have a model which have FileField field and in this model we have millions of records. class MyModel(models.Model): media = models.FileField(upload_to=my_function, db_index=True) ... These media records are stored in database…
uedemir
  • 1,654
  • 1
  • 12
  • 21
1
vote
2 answers

Match specific string before user input

I have the following strings: SDZ420-1241242, AS42-9639263, SPF3-2352353 I want to "escape" the SDZ420- part while searching and only search using the last digits, so far I've tried RLIKE '^[a-zA-Z\d-]' which works but I am confused on how to add…
Xmair
  • 13
  • 2
1
vote
1 answer

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…
user10398534
  • 145
  • 14
0
votes
1 answer

Need regex for SQL to extract substring from a long string

I have the below string in my database (SnowFlake) :display_redemption_mark: 0 :redeemable_properties:…
Shubham Srivastava
  • 1,190
  • 14
  • 28
0
votes
2 answers

How to delete certain characters from table values?

I have a table. In one of the columns of the table , the values have this form: Value1(12) Value2(45) Value3(35) Value4(37) Value5(17) How to delete the opening parenthesis, the value inside the parentheses and the closing parenthesis? So that after…
Serj
  • 27
  • 4
0
votes
0 answers

How can I find not same data using mysql regexp in multiline text?

I tried to find the data using regexp in multiline text. My regexp is 'Audit Policy,[A-Za-z0-9|[:space:]]+,Success and Failure'. # query SELECT * FROM docs WHERE content not regexp 'Audit Policy,[A-Za-z0-9|[:space:]]+,Success and Failure'; #…
Bethlee
  • 825
  • 3
  • 17
  • 28
0
votes
1 answer

How to compare a parameter of a Stored procedure with a REGEXP

I have a stored Procedure that I want to use for validations in the tables, and I have a regexp that I need to compare one of the parameters, how can I compare the regexp with my parameter. I tried this: SELECT id REGEXP…
0
votes
1 answer

MySQL throwing error "Error Code: 3685. Illegal argument to a regular expression" when calculating accurate occurrence of phrase(s) inside column

As I mentioned in the Q-title, as now the MySQL has been heavily upgraded to version 8, which expectedly provides much new features including shortened characters for Word Boundary matching, calculating exact occurrence of phrase(s) inside column…
Vicky Dev
  • 1,893
  • 2
  • 27
  • 62
0
votes
3 answers

MySQL REGEXP to check a string contains all these characters in any order

I'm trying to write a query that searches a list of words. One of the conditions is to check words that contain (in any order) a any of the characters in string. For example the word must contain 'o' and 'd' in any order, so 'ABDOMEN' and…
TenG
  • 3,843
  • 2
  • 25
  • 42
0
votes
0 answers

[MYSQL][Regular expression] Parsing a string and construct some information from it ini mysql

In a table in my database I have a sentence. I am trying to parse t and construct the categories. The dimensions of the Item is Height:200, Width:500. And it is in red color. Height and width can take some standard integers [100, 200, 300, ...] I…
Manikanta
  • 223
  • 3
  • 18
0
votes
0 answers

How to ignore src, href in search query MySQL?

I have a record in product table and have string field content like this
something
the moon
  • 29
  • 2
  • 9
0
votes
1 answer

MYSQL: IF having OR condition & REGEXP match

Goal: To block inserts into database table using trigger having multiple conditions Description: Trying to block lots of irrelevant entries in contact table. I have created a profanity table having lot of bad/swear/dirty words and a regular…
Aakash Sahai
  • 3,935
  • 7
  • 27
  • 41
-2
votes
1 answer

How to do Regular Expressions in JavaScript, Python, and SQL with multiple brackets and generate string from brackets that contains specific character

So, I have this data {"ABC":"Hello"},{"DEF":"World"},{"GHI":"!!!"} How to make a regex to generate a string inside brackets that contains ABC so it will return Hello? I also want to generate a string inside brackets that contains GHI so it will…
-2
votes
1 answer

MySql - Select records like a particular number present in a string and separated by commas

I have a table named product_info containing the following data: +-------------+------------+----------------+ | title | slug | tags_id | +-------------+------------+----------------+ | Maserti | /maserati | 10,34,7,110 …
sheikhamir
  • 17
  • 4