table arts
column title
– example:
1122 A TITLE
025 - ANOTHER TITLE
1/7 - SOME TITLE
1 4 5 - SOME ANOTHER TITLE
I need to remove everything before the real title.
Characters for removing are – everything except letters (titles should start with a letter).
So I need something like:
update arts set title = replace(title, 'everything except letters on the beginning', '');
Using php
or mysql
inside phpmyadmin
.
Any help?
3
Answers
Use regex to match anything up to first letter, then capture the rest.
Output:
https://3v4l.org/4sZ9I
You can filter it out with a regular expression:
I think it is better to do all these operations at PHP side, because mysql does not support this, If you really want to do this at MySQL side then you need to write your own custom function,
Try with PHP code as follow.
Above code will generate output as follow
update arts set title = “SOME ANOTHER TITLE”
Demo