MySQL Forums
Forum List  »  UDF

lib_mysqludf_preg returns more then one row.
Posted by: Mark Webley
Date: October 04, 2014 06:06PM

Anyone with experience with lib_mysqludf_preg?

To simply the query example:
In this example my RegExp allows a user to search for the text "cooking meats" in table cell called "description"
SELECT PREG_CAPTURE( '/([-''&@#,\\w\\s\\.]*cooking meats[-''&@#,\\w\\s\\.]*)/im' , description, 1, 1) FROM listOfBooks WHERE book = 'cheap' AND version = "neweditions";

If a match is found in more then one row (multiple rows) PREG_CAPTURE returns NULLS, results:

If it only existing in one row, it works returns:
I like cooking meats in my kitchen

Has anyone ever found a solution to PREG_CAPTURE returning multiple rows with the strings matches as the result?

Options: ReplyQuote

Written By
lib_mysqludf_preg returns more then one row.
October 04, 2014 06:06PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.