Tagged Questions
4
votes
1answer
30 views
Mysql, dealing with String Regex
I'm developing a Java desktop application that connects with a database, and I would like to know the next. It results that as far as I know, Prepared Statements avoid SQL injections while you don't ...
0
votes
0answers
55 views
Search three fields using REGEXP and avoiding empty substring error
I have one search form that searches database fields 'name' and 'address', and a drop down list that searches the database field 'type' and displays the results in a search_results.php page. My basic ...
0
votes
1answer
50 views
MySql REGEXP to match two comma separated strings
I have a table containing following values :
id | value |
-----------------------
1 | 1,2,5,8,12,20 |
2 | 11,25,26,28 |
-----------------------
now I want to search ...
-7
votes
5answers
82 views
Difference Between '+' and '*' operation pattern in REGEXP [closed]
I have a table CANDIDATE in my db which is running under MySQL 5.5 and I am trying to get rows from table where xy is contains in firstname, so I can run below two queries
SELECT FIRSTNAME FROM ...
1
vote
3answers
31 views
MySQL | REGEXP VS Like
I have a table CANDIDATE in my db which is running under MySQL 5.5 and I am trying to get rows from table where RAM is contains in firstname, so I can run below two queries, but I would like to now ...
-2
votes
2answers
37 views
A regex to validate an email [duplicate]
I need to validate and email address when someone signs up.it should be something like [email protected]
7 numbers @ and last part should be exactly like burnswin.edu.au
Please ...
1
vote
1answer
47 views
What is the MySQL SQL REGEX for this regex
Regular regex:
foo(\((\d{1}|\d{2}|\d{3})\))?
This regex works in Java:
foo(\\((\\d{1}|\\d{2}|\\d{3})\\))?
Examples:
fooa //no match
foo(1)a //no match
foo(a) //no match
foo(1) ...
1
vote
2answers
38 views
MySQL: Is it safe to lowercase or uppercase regular expression?
I use regular expressions in MySQL on multibyte-encoded (utf-8) data, but I need it to be match case-insensitively. As MySQL has bug (for many years unresolved) that it can't deal properly with ...
2
votes
1answer
40 views
How do I use a regex in my MySQL query?
I want to search for a word+number if that SQL returns nothing, I will default it to a full LIKE search, is there any way to implement regex like this in SQL?
Example:
$queryWord = potato
It ...
1
vote
1answer
39 views
Retrieve a Regex Pattern from a MySQL table
I have a table in MySQL containing regex pattern such as : FILE\\\\d{1,4}.
But while trying to retrieve the pattern value with a Java code, it seems like the value is not in the good format.
How can I ...
1
vote
2answers
41 views
find records starting with special characters using REGEXP in MYSQL
Ok, so i am wanting to fetch results that start with a number and i have this regexp for finding only numerical entries
SELECT * FROM dbname WHERE subject REGEXP '^[0-9]'
but what if i want it to ...
-3
votes
0answers
38 views
Regular Expressions: Returning the string doubled from MySQL database [closed]
I have a problem:
I have multiple articles in a database: All articles are in one table cell divided by a - (minus sign):
Example: This is article Article 1 - This is article Article 2 - This is ...
0
votes
2answers
39 views
Is this the best approach to this complex MySQL multi table query?
I'm building a complex multi-table MySQL query, and even though it works, I'm wondering could I make it more simple.
The idea behind it is this, using the Events table that logs all site interaction, ...
0
votes
2answers
34 views
How to replace non-numiric characters from a string MySQL
I need a better way to replace a non-numeric characters in a string.
I have phone numbers like so
(888) 488-6655
888-555-8888
blah blah blah
So I am able to return a clean string by using a simple ...
0
votes
1answer
40 views
How to check for uppercase letters in MySQL?
I want to check, if a string consits only of uppercase letters. I know that RLIKE/REGEXP are not case sensitive in MySQL. So I tried to use the :upper: character class:
SELECT 'z' REGEXP ...