Answer the question
In order to leave comments, you need to log in
Why does a site on Laravel 5.5.40 not accept tags and META Keywords in Russian when publishing a post?
There is a project for starter site here https://github.com/bestmomo/laravel5-5-example
I installed it. If you add a new post from the admin panel and use tags and META Keywords in English, then the post is published normally. If you write tags and META Keywords in Russian, then the input fields for these data turn red and at the bottom there is such an inscription
Tags, separated by commas (no spaces), should have a maximum of 50 characters.and such
Keywords, separated by commas (no spaces), should have a maximum of 50 characters.
$regex = '/^[A-Za-z0-9-éèàù]{1,50}?(,[A-Za-z0-9-éèàù]{1,50})*$/';
$regex = '/^[A-Za-z0-9-А-Яа-я0-9]{1,50}?(,[A-Za-z0-9-А-Яа-я0-9]{1,50})*$/';
éiau
Answer the question
In order to leave comments, you need to log in
Try
$regex = '/^[A-Za-z0-9-A-Za-z0-9]{1,50}?(,[A-Za-z0-9-A-Za-z0-9]{ 1.50})*$/ u ';
docs.php.net/manual/en/intro.mbstring.php
Make sure that it's a regular expression (try to remove it altogether), rewrite it in an editor with regular expression support so that you understand what's going on in it and where the problem is.
For example, in this piece
[A-Za-z0-9-A-Yaa-z0-9]
0-9 is repeated twice, after the first 0-9 there is an extra hyphen.
[A-Za-z0-9A-Zaa-z]
Maybe this will help, but you still need to understand what is happening in the expression.
The characters you specified (éèàù) are simply listed as valid.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question