![]() |
Multilanguage validation with German "Umlaute" - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Multilanguage validation with German "Umlaute" (/showthread.php?tid=80934) |
Multilanguage validation with German "Umlaute" - sprhld - 01-04-2022 Hello! Today I was working in more details with the valitaion. I choose the model to add the rules and messages. But while testing, I go always an error, when a German "Umlaut" was part of the text. I don't know how to solve this, I didn't find anything ![]() Here a short examle of the validation: PHP Code: 'street_no' => 'required|alpha_numeric_space|min_length[5]', PHP Code: Düsseldorfer Straße Has anyone an Idea hot to upgrade the validation? Or is there an other solution? Thank you! RE: Multilanguage validation with German "Umlaute" - includebeer - 01-04-2022 I think you will need to use the regex_match rule and define a regex expression to include the German characters: https://codeigniter.com/user_guide/libraries/validation.html#available-rules RE: Multilanguage validation with German "Umlaute" - sprhld - 01-04-2022 That was not as hard as I thougt. I saw regex in the docs, regex but regex is regex... ![]() So my working solution is now: PHP Code: 'surename' => 'required|regex_match[/[a-zA-Z ÄäÖöÜüß]/]|min_length[2]', // instead alpha_space ![]() RE: Multilanguage validation with German "Umlaute" - includebeer - 01-04-2022 Yeah regex can be confusing, that's why I always use a regex website to test mine! ![]() RE: Multilanguage validation with German "Umlaute" - sprhld - 01-21-2022 (01-04-2022, 12:49 PM)includebeer Wrote: Yeah regex can be confusing, that's why I always use a regex website to test mine! First I should learn regex before using a testing-website ![]() |