0

Im trying

That:

SELECT * FROM `db_name` WHERE `username` = REGEXP "/(.)(?=.*\1)/g"

and it returns no data, any walkarounds?

Well what im trying to get is, all data where the username contains duplicated letter or number , such as "x34x", "aafdgd"

the regex works properly on the language directly(PHP), but i want it to work at the database level.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Ahmed Ali
  • 123
  • 1
  • 9
  • 1
    No workarounds really, but [see here](https://stackoverflow.com/questions/14574990/finding-strings-with-duplicate-letters-inside) for one option. MySQL's regex engine does not support backreferences. – Tim Biegeleisen May 29 '22 at 10:12

1 Answers1

0

Well, what i did because i didnt find any solution is:

for the existing records: i made new column (has_repeater), and i made an code that checks if it is repeated in regex ( php ), then it set value for true/false.

it auto sets (has_repeater) while adding the record.

Ahmed Ali
  • 123
  • 1
  • 9