note 130149 added to reference.pcre.pattern.syntax

From: Date: Mon, 17 Mar 2025 15:42:22 +0000
Subject: note 130149 added to reference.pcre.pattern.syntax
Groups: php.notes 
Request: Send a blank email to php-notes+get-221981@lists.php.net to get a copy of this message
I am coding a lightweight webApp that uses simple text files to store data in JSON format instead of a heavyweight DBMS. I encountered a problem with incorrect processing of the Russian alphabet by regular expression functions, especially such as preg_match() , including when using the UTF-8 encoding. Having studied numerous English and Russian-language forums and PHP manual (as thoroughly as I could), I realized that the the problem cannot be solved. Thus, searching and replacing long strings with a wide variety of characters (especially slashes "\\" and backslashes "\/") using native PHP tools is impossible. The solution to the problem seems to be in changing the approach to solving it. 1) You can use another programming language where this problem is solved. 2) In my case, when creating a file to store data in the JSON format, I followed the DBMS practice and simply added a digital identifier (id) to the array for each row. Now I can easily search for the desired row in my imagina ry DB and change any of its parameters/properties. {"id":104,"context":"Convertion", "type":"null"} ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 95.26.231.68) ---- Manual Page -- https://php.net/manual/en/reference.pcre.pattern.syntax.php Edit -- https://main.php.net/note/edit/130149 Del: integrated -- https://main.php.net/note/delete/130149/integrated Del: useless -- https://main.php.net/note/delete/130149/useless Del: bad code -- https://main.php.net/note/delete/130149/bad+code Del: spam -- https://main.php.net/note/delete/130149/spam Del: non-english -- https://main.php.net/note/delete/130149/non-english Del: in docs -- https://main.php.net/note/delete/130149/in+docs Del: other reasons-- https://main.php.net/note/delete/130149 Reject -- https://main.php.net/note/reject/130149 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221981) next »