note 112864 added to solrutils.escapequerychars

From: Date: Tue, 30 Jul 2013 20:51:06 +0000
Subject: note 112864 added to solrutils.escapequerychars
Groups: php.notes 
Request: Send a blank email to php-notes+get-195828@lists.php.net to get a copy of this message
A way of doing that with a regular expression: <?php // Lucene characters that need escaping with \ are + - && || ! ( ) { } [ ] ^ " ~ * ? : \ $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~*?:\\'); $query = preg_replace_callback( '/([' . $luceneReservedCharacters . '])/', function($matches) { return '\\' . $matches[0]; }, $query); ?> ---- Server IP: 69.147.83.199 Probable Submitter: 86.29.60.37 ---- Manual Page -- http://php.net/manual/en/solrutils.escapequerychars.php Edit -- https://master.php.net/note/edit/112864 Del: integrated -- https://master.php.net/note/delete/112864/integrated Del: useless -- https://master.php.net/note/delete/112864/useless Del: bad code -- https://master.php.net/note/delete/112864/bad+code Del: spam -- https://master.php.net/note/delete/112864/spam Del: non-english -- https://master.php.net/note/delete/112864/non-english Del: in docs -- https://master.php.net/note/delete/112864/in+docs Del: other reasons-- https://master.php.net/note/delete/112864 Reject -- https://master.php.net/note/reject/112864 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195828) next »