Jump to content

Problem with REGEXP '[[:<:]]mr.[[:>:]]'


j_carmack

Recommended Posts

Hi All

 

My Specs:

 

MySQL

    * Server: localhost via TCP/IP

    * Server Version: 5.1.41

    * Protokoll-Version: 10

    * Benutzer: root@localhost

    * MySQL-Zeichensatz: UTF-8 Unicode (utf8)

Webserver

    * Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

    * MySQL-Client-Version: 5.1.41

phpMyAdmin

    * Versionsinformationen: 3.2.4

 

I executed the following querys with phpMyAdmin :

SELECT * FROM `t_titel` WHERE t_titel.TitelSearchString REGEXP '[[:<:]]mr.[[:>:]]'

 

and i would like to find the following result :

"Titel_ID";"TitelCaption";"TitelSearchString";"TitelOrderString";"TitelOrig";"TitelOrigVorschlag";"TitelOrigSearchString";"TitelOrigOrderString";"TitelLaender";"TitelRelDate";"TitelRelYear";"VerleihID";"vonArtikelNr"
"4161";"Mr. & Mrs. Smith";"mr. & mrs. smith";"Mr. & Mrs. Smith";"Mr. & Mrs. Smith";"Mr. & Mrs. Smith";"mr. & mrs. smith";"Mr. & Mrs. Smith";"Stati Uniti";;"2005";"1";"F4582"

 

but it finds 3 results :

"Titel_ID";"TitelCaption";"TitelSearchString";"TitelOrderString";"TitelOrig";"TitelOrigVorschlag";"TitelOrigSearchString";"TitelOrigOrderString";"TitelLaender";"TitelRelDate";"TitelRelYear";"VerleihID";"vonArtikelNr"
"2617";"Mrs. Doubtfire";"mrs. doubtfire";"Mrs. Doubtfire";"Mrs. Doubtfire";"Mrs. Doubtfire";"mrs. doubtfire";"Mrs. Doubtfire";"Stati Uniti";;"1993";"2";"F2960"
"4161";"Mr. & Mrs. Smith";"mr. & mrs. smith";"Mr. & Mrs. Smith";"Mr. & Mrs. Smith";"Mr. & Mrs. Smith";"mr. & mrs. smith";"Mr. & Mrs. Smith";"Stati Uniti";;"2005";"1";"F4582"
"12099";"Mrs. Miller";"mrs. miller";"Mrs. Miller";;;;;;;"2003";NULL;"M7238"

 

at the opposite when i execute the following query it finds 0 results

SELECT * FROM `t_titel` WHERE t_titel.TitelSearchString REGEXP '[[:<:]]mrs.[[:>:]]'

 

even when i escape the point like that it does not find any results

SELECT * FROM `t_titel` WHERE t_titel.TitelSearchString REGEXP '[[:<:]]mrs\.[[:>:]]'

 

And i do not understand why the first query finds 3 rows with mrs. in it and the second finds nothing.

 

I hope somebody can tell me what i am doing wrong.

 

 

 

Thank you for reading about my problems and sorry for my poor English.

 

 

 

If you want to test it yourself :

-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 17. Dezember 2010 um 01:13
-- Server Version: 5.1.41
-- PHP-Version: 5.3.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Datenbank: `develozo_dvdev3`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `t_titel`
--

CREATE TABLE IF NOT EXISTS `t_titel` (
  `Titel_ID` int(11) NOT NULL AUTO_INCREMENT,
  `TitelCaption` varchar(255) DEFAULT NULL,
  `TitelSearchString` varchar(255) DEFAULT NULL,
  `TitelOrderString` varchar(255) DEFAULT NULL,
  `TitelOrig` varchar(255) DEFAULT NULL,
  `TitelOrigVorschlag` varchar(255) DEFAULT NULL,
  `TitelOrigSearchString` varchar(255) DEFAULT NULL,
  `TitelOrigOrderString` varchar(255) DEFAULT NULL,
  `TitelLaender` varchar(255) DEFAULT NULL,
  `TitelRelDate` varchar(5) DEFAULT NULL,
  `TitelRelYear` varchar(50) DEFAULT NULL,
  `VerleihID` int(11) DEFAULT NULL,
  `vonArtikelNr` varchar(15) NOT NULL,
  PRIMARY KEY (`Titel_ID`),
  KEY `VerleihID` (`VerleihID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=19619 ;

--
-- Daten für Tabelle `t_titel`
--

INSERT INTO `t_titel` (`Titel_ID`, `TitelCaption`, `TitelSearchString`, `TitelOrderString`, `TitelOrig`, `TitelOrigVorschlag`, `TitelOrigSearchString`, `TitelOrigOrderString`, `TitelLaender`, `TitelRelDate`, `TitelRelYear`, `VerleihID`, `vonArtikelNr`) VALUES
(2617, 'Mrs. Doubtfire', 'mrs. doubtfire', 'Mrs. Doubtfire', 'Mrs. Doubtfire', 'Mrs. Doubtfire', 'mrs. doubtfire', 'Mrs. Doubtfire', 'Stati Uniti', '', '1993', 2, 'F2960'),
(4161, 'Mr. & Mrs. Smith', 'mr. & mrs. smith', 'Mr. & Mrs. Smith', 'Mr. & Mrs. Smith', 'Mr. & Mrs. Smith', 'mr. & mrs. smith', 'Mr. & Mrs. Smith', 'Stati Uniti', '', '2005', 1, 'F4582'),
(12099, 'Mrs. Miller', 'mrs. miller', 'Mrs. Miller', '', '', '', '', '', '', '2003', NULL, 'M7238');

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/221928-problem-with-regexp/
Share on other sites

Hi

 

Thanks for your suggestion.

 

In my query I use 2 types of searches one with LIKE and the other with REGEXP because i have to differentiate between single words and fragments.

so i use the suggested query for fragments because it finds fragments inside of words.

 

take "bond" as an example:

 

searching for the single word

SELECT * FROM `t_titel` WHERE t_titel.TitelSearchString REGEXP '[[:<:]]bond[[:>:]]'

 

"Titel_ID";"TitelCaption";"TitelSearchString";"TitelOrderString";"TitelOrig";"TitelOrigVorschlag";"TitelOrigSearchString";"TitelOrigOrderString";"TitelLaender";"TitelRelDate";"TitelRelYear";"VerleihID";"vonArtikelNr"
"18970";"The Secret Bond";"the secret bond";"Secret Bond";;;;;;;"2010";NULL;"M16556"

 

and searching for fragments in the word

SELECT * FROM `t_titel` WHERE t_titel.TitelSearchString LIKE '%bond%'

 

"Titel_ID";"TitelCaption";"TitelSearchString";"TitelOrderString";"TitelOrig";"TitelOrigVorschlag";"TitelOrigSearchString";"TitelOrigOrderString";"TitelLaender";"TitelRelDate";"TitelRelYear";"VerleihID";"vonArtikelNr"
"5738";"Il vagabondo";"il vagabondo";"vagabondo";;;;;"Italia";;"1941";"25";"F6495"
"11598";"Bondo! Bondo!";"bondo! bondo!";"Bondo! Bondo!";;;;;;;"2002";NULL;"M5744"
"15665";"Vagabondo";"vagabondo";"Vagabondo";;;;;;;"2007";NULL;"M12828"
"16247";"Io vagabondo - The Capitol Collection";"io vagabondo - the capitol collection";"Io vagabondo - The Capitol Collection";;;;;;;"2008";NULL;"M13520"
"18457";"Chitarra vagabonda";"chitarra vagabonda";"Chitarra vagabonda";;;;;;;"2009";NULL;"M16039"
"18970";"The Secret Bond";"the secret bond";"Secret Bond";;;;;;;"2010";NULL;"M16556"
"19390";"Il mondo e l'abbondanza";"il mondo e l'abbondanza";"mondo e l'abbondanza";;;;;;;"2010";NULL;"M16982"
"19442";"Una piccola ape furibonda - Giovanni Nuti canta Alda Merini";"una piccola ape furibonda - giovanni nuti canta alda merini";"piccola ape furibonda - Giovanni Nuti canta Alda Merini";;;;;;;"2010";NULL;"M17035"

 

I hope you see why i have to use this REGEXP search.

The problem actually is only with "mr." and "mrs." and similar words like "dr." etc.

 

 


Only for realy interested people :-)

 

If you are interested. Here is the complete query as i have it now.

In this query i am searching for "james bond sean connery terence young". -> Title + Actor + Director

 

SELECT
            IF
            (
                    (
                    (t_artikel.ArtikelSearchString REGEXP '[[:<:]]james[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]james[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]james[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]james[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]james[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]james[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]james[[:>:]]')
				)
				AND
				((t_artikel.ArtikelSearchString REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]bond[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]bond[[:>:]]')
				)
				AND
				((t_artikel.ArtikelSearchString REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]sean[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]sean[[:>:]]')
				)
				AND
				((t_artikel.ArtikelSearchString REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]connery[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]connery[[:>:]]')
				)
				AND
				((t_artikel.ArtikelSearchString REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]terence[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]terence[[:>:]]')
				)
				AND
				((t_artikel.ArtikelSearchString REGEXP '[[:<:]]young[[:>:]]')
				OR(t_titel.TitelSearchString REGEXP '[[:<:]]young[[:>:]]')
				OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]young[[:>:]]')
				OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]young[[:>:]]')
				OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]young[[:>:]]')
				OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]young[[:>:]]')
				OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]young[[:>:]]')

                    )
                    ,
                    IF
                    (
                            t_artikel.ArtikelGenre = 2,
                            3,
                            IF
                            (
                                    t_warengruppen.WG_ID = 10,
                                    2,
                                    1
                            )
                    ),
                    IF
                    (
                            (
                            (t_artikel.ArtikelSearchString LIKE '%james%')
						OR(t_titel.TitelSearchString LIKE '%james%')
						OR(t_titel.TitelOrigSearchString LIKE '%james%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%james%')
						OR(t_titelactors.TitelActorsSearch LIKE '%james%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%james%')
						OR(t_seriendetails.SerienDetail LIKE '%james%')
						)
						AND
						((t_artikel.ArtikelSearchString LIKE '%bond%')
						OR(t_titel.TitelSearchString LIKE '%bond%')
						OR(t_titel.TitelOrigSearchString LIKE '%bond%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%bond%')
						OR(t_titelactors.TitelActorsSearch LIKE '%bond%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%bond%')
						OR(t_seriendetails.SerienDetail LIKE '%bond%')
						)
						AND
						((t_artikel.ArtikelSearchString LIKE '%sean%')
						OR(t_titel.TitelSearchString LIKE '%sean%')
						OR(t_titel.TitelOrigSearchString LIKE '%sean%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%sean%')
						OR(t_titelactors.TitelActorsSearch LIKE '%sean%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%sean%')
						OR(t_seriendetails.SerienDetail LIKE '%sean%')
						)
						AND
						((t_artikel.ArtikelSearchString LIKE '%connery%')
						OR(t_titel.TitelSearchString LIKE '%connery%')
						OR(t_titel.TitelOrigSearchString LIKE '%connery%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%connery%')
						OR(t_titelactors.TitelActorsSearch LIKE '%connery%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%connery%')
						OR(t_seriendetails.SerienDetail LIKE '%connery%')
						)
						AND
						((t_artikel.ArtikelSearchString LIKE '%terence%')
						OR(t_titel.TitelSearchString LIKE '%terence%')
						OR(t_titel.TitelOrigSearchString LIKE '%terence%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%terence%')
						OR(t_titelactors.TitelActorsSearch LIKE '%terence%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%terence%')
						OR(t_seriendetails.SerienDetail LIKE '%terence%')
						)
						AND
						((t_artikel.ArtikelSearchString LIKE '%young%')
						OR(t_titel.TitelSearchString LIKE '%young%')
						OR(t_titel.TitelOrigSearchString LIKE '%young%')
						OR(t_titelactors.TitelDirectorsSearch LIKE '%young%')
						OR(t_titelactors.TitelActorsSearch LIKE '%young%')
						OR(t_artikelnamezusatz.Zusatz LIKE '%young%')
						OR(t_seriendetails.SerienDetail LIKE '%young%')

                            )
                            ,
                            4,
                            0
                    )
            )
            AS typeorder,
            t_artikel.Artikel_ID,
            t_artikel.Katalognummer,
            t_artikel.ArtikelName,
            t_artikel.ArtikelNameNur,
            t_artikel.ArtikelAnzahlTitel,
            t_artikel.ArtikelSearchString,
            t_artikel.ArtikelRelYear,
            t_artikel.IDFormatiert,
            t_artikel.VP_ALT,
            t_artikel.ArtikelUnits,
            t_artikel.ArtikelShopEnd,
            t_artikel.BoxHauptWgID,
            t_artikel.ArtikelType,
            t_artikel.ArtikelGenre,
                    t_titel.Titel_ID,
                    t_titel.TitelCaption,
                    t_titel.TitelOrig,
                    t_titel.TitelSearchString,
                    t_titel.TitelOrigSearchString,
                    t_titel.TitelRelYear,
                    t_titel.TitelLaender,
                            t_seriendetails.SerienDetail,
                                    t_warengruppen.WgCaption,
                                    t_warengruppen.WG_ID,
                                            t_wgzusatztexte.WgZusatztext,
                                                    t_titelactors.TitelDirectors,
                                                    t_titelactors.TitelActors,
                                                            t_artikelnamezusatz.Zusatz
            FROM t_artikel
            LEFT JOIN tc_artikel_medium ON (t_artikel.Artikel_ID = tc_artikel_medium.ArtikelID)
                    LEFT JOIN tc_medium_titel ON (tc_artikel_medium.Artikel_Medium_ID = tc_medium_titel.ArtikelMediumID)
                            LEFT JOIN t_titel ON (tc_medium_titel.TitelID = t_titel.Titel_ID)
                                    LEFT JOIN t_seriendetails ON (tc_medium_titel.SerienDetailID = t_seriendetails.SerienDetail_ID)
                                            LEFT JOIN t_warengruppen ON (t_artikel.ArtikelWgID = t_warengruppen.WG_ID)
                                                    LEFT JOIN t_artikeldivers ON (t_artikel.Artikel_ID = t_artikeldivers.ArtikelID)
                                                            LEFT JOIN t_wgzusatztexte ON (t_artikeldivers.WgZusatztextID = t_wgzusatztexte.WgZusatztext_ID)
                                                                    LEFT JOIN t_titelactors ON (t_titel.Titel_ID = t_titelactors.TitelID)
                                                                            LEFT JOIN t_artikelnamezusatz ON (t_artikel.ArtikelnameZusatzID = t_artikelnamezusatz.ArtikelnameZusatz_ID)
            WHERE t_artikel.ArtikelType = 20
                    AND
                    (
                            t_artikel.ArtikelShopEnd >= '2010-11-17'
                            OR t_artikel.ArtikelShopEnd IS NULL
                    )
                    AND
                    (
                            (
                                (
                                (t_artikel.ArtikelSearchString REGEXP '[[:<:]]james[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]james[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]james[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]james[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]james[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]james[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]james[[:>:]]')
							)
							AND
							((t_artikel.ArtikelSearchString REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]bond[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]bond[[:>:]]')
							)
							AND
							((t_artikel.ArtikelSearchString REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]sean[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]sean[[:>:]]')
							)
							AND
							((t_artikel.ArtikelSearchString REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]connery[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]connery[[:>:]]')
							)
							AND
							((t_artikel.ArtikelSearchString REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]terence[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]terence[[:>:]]')
							)
							AND
							((t_artikel.ArtikelSearchString REGEXP '[[:<:]]young[[:>:]]')
							OR(t_titel.TitelSearchString REGEXP '[[:<:]]young[[:>:]]')
							OR(t_titel.TitelOrigSearchString REGEXP '[[:<:]]young[[:>:]]')
							OR(t_titelactors.TitelDirectorsSearch REGEXP '[[:<:]]young[[:>:]]')
							OR(t_titelactors.TitelActorsSearch REGEXP '[[:<:]]young[[:>:]]')
							OR(t_artikelnamezusatz.Zusatz REGEXP '[[:<:]]young[[:>:]]')
							OR(t_seriendetails.SerienDetail REGEXP '[[:<:]]young[[:>:]]')

                                )
                            )
                            OR
                            (
                                (
                                (t_artikel.ArtikelSearchString LIKE '%james%')
							OR(t_titel.TitelSearchString LIKE '%james%')
							OR(t_titel.TitelOrigSearchString LIKE '%james%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%james%')
							OR(t_titelactors.TitelActorsSearch LIKE '%james%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%james%')
							OR(t_seriendetails.SerienDetail LIKE '%james%')
							)
							AND
							((t_artikel.ArtikelSearchString LIKE '%bond%')
							OR(t_titel.TitelSearchString LIKE '%bond%')
							OR(t_titel.TitelOrigSearchString LIKE '%bond%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%bond%')
							OR(t_titelactors.TitelActorsSearch LIKE '%bond%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%bond%')
							OR(t_seriendetails.SerienDetail LIKE '%bond%')
							)
							AND
							((t_artikel.ArtikelSearchString LIKE '%sean%')
							OR(t_titel.TitelSearchString LIKE '%sean%')
							OR(t_titel.TitelOrigSearchString LIKE '%sean%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%sean%')
							OR(t_titelactors.TitelActorsSearch LIKE '%sean%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%sean%')
							OR(t_seriendetails.SerienDetail LIKE '%sean%')
							)
							AND
							((t_artikel.ArtikelSearchString LIKE '%connery%')
							OR(t_titel.TitelSearchString LIKE '%connery%')
							OR(t_titel.TitelOrigSearchString LIKE '%connery%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%connery%')
							OR(t_titelactors.TitelActorsSearch LIKE '%connery%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%connery%')
							OR(t_seriendetails.SerienDetail LIKE '%connery%')
							)
							AND
							((t_artikel.ArtikelSearchString LIKE '%terence%')
							OR(t_titel.TitelSearchString LIKE '%terence%')
							OR(t_titel.TitelOrigSearchString LIKE '%terence%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%terence%')
							OR(t_titelactors.TitelActorsSearch LIKE '%terence%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%terence%')
							OR(t_seriendetails.SerienDetail LIKE '%terence%')
							)
							AND
							((t_artikel.ArtikelSearchString LIKE '%young%')
							OR(t_titel.TitelSearchString LIKE '%young%')
							OR(t_titel.TitelOrigSearchString LIKE '%young%')
							OR(t_titelactors.TitelDirectorsSearch LIKE '%young%')
							OR(t_titelactors.TitelActorsSearch LIKE '%young%')
							OR(t_artikelnamezusatz.Zusatz LIKE '%young%')
							OR(t_seriendetails.SerienDetail LIKE '%young%')

                                )
                            )
                    )
            ORDER BY typeorder ASC, t_artikel.ArtikelName ASC, t_seriendetails.SerienDetail ASC, t_warengruppen.WG_ID ASC, t_artikelnamezusatz.Zusatz ASC

 

The result :

"typeorder";"Artikel_ID";"Katalognummer";"ArtikelName";"ArtikelNameNur";"ArtikelAnzahlTitel";"ArtikelSearchString";"ArtikelRelYear";"IDFormatiert";"VP_ALT";"ArtikelUnits";"ArtikelShopEnd";"BoxHauptWgID";"ArtikelType";"ArtikelGenre";"Titel_ID";"TitelCaption";"TitelOrig";"TitelSearchString";"TitelOrigSearchString";"TitelRelYear";"TitelLaender";"SerienDetail";"WgCaption";"WG_ID";"WgZusatztext";"TitelDirectors";"TitelActors";"Zusatz"
"1";"F7890";"8010312079986";"James Bond 007&#58; Dalla Russia con amore - From Russia with Love";"James Bond 007";"1";"james bond 007&#58; dalla russia con amore - from russia with love";"2009";"F0007890";"19.5";"2";NULL;"6";"20";"1";"4277";"Dalla Russia con amore";"From Russia with Love";"dalla russia con amore";"from russia with love";"1963";"Gran Bretagna";NULL;"DVD";"6";NULL;"Vari <> Terence Young";"Sean Connery <> Robert Shaw <> Pedro Armendáriz <> Daniela Bianchi <> Lotte Lenya <> Bernard Lee <> Eunice Gayson <> Walter Gotell";"Ultimate Edition"
"1";"F7896";"8010312080159";"James Bond 007&#58; Licenza di uccidere - Dr. No";"James Bond 007";"1";"james bond 007&#58; licenza di uccidere - dr. no";"2009";"F0007896";"19.5";"2";NULL;"6";"20";"1";"4276";"Licenza di uccidere";"Dr. No";"licenza di uccidere";"dr. no";"1962";"Gran Bretagna";NULL;"DVD";"6";NULL;"Vari <> Terence Young";"Sean Connery <> Ursula Andress <> Joseph Wiseman <> Anthony Dawson <> Lois Maxwell <> Bernard Lee <> Eunice Gayson <> Jack Lord <> Zena Marshall <> John Kitzmiller <> Peter Burton <> Yvonne Shima <> Michel Mok";"Ultimate Edition"
"1";"F7903";"8010312080098";"James Bond 007&#58; Thunderball: Operazione Tuono - Thunderball";"James Bond 007";"1";"james bond 007&#58; thunderball: operazione tuono - thunderball";"2009";"F0007903";"19.5";"2";NULL;"6";"20";"1";"4279";"Thunderball: operazione Tuono";"Thunderball";"thunderball: operazione tuono";"thunderball";"1965";"Gran Bretagna";NULL;"DVD";"6";NULL;"Vari <> Terence Young";"Sean Connery <> Adolfo Celi <> Martine Beswick <> Luciana Paluzzi <> Claudine Auger <> Guy Doleman <> Rik Van Nutter <> Lois Maxwell <> Bernard Lee <> Desmond Llewelyn <> Molly Peters";"Ultimate Edition"
"2";"F7194";"8010312080203";"James Bond 007 - Monsterbox&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: Operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Al servizio segreto di sua maestà - On Her Majesty's Secret Service / Una cascata di diamanti - Diamonds Are Forever / Vivi e lascia morire - Live and Let Die / L'uomo dalla pistola d'oro - The Man with the Golden Gun / La spia che mi amava - The Spy Who Loved Me / Moonraker: Operazione spazio - Moonraker / Solo per i tuoi occhi - For Your Eyes Only / Octopussy: Operazione Piovra - Octopussy / Bersaglio mobile - A View to a Kill / Vendetta privata - Licence to Kill / Goldeneye - GoldenEye / Il domani non muore mai - Tomorrow Never Dies / Il mondo non basta - The World Is Not Enough / La morte può attendere - Die Another Day / Zona pericolo - The Living Daylights / Casino Royale - Casino Royale";"James Bond 007 - Monsterbox";"21";"james bond 007 - monsterbox&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice / al servizio se";"2008";"F0007194";"369";"1";NULL;"6";"20";"1";"4276";"Licenza di uccidere";"Dr. No";"licenza di uccidere";"dr. no";"1962";"Gran Bretagna";NULL;"Boxset";"10";"42DVD";"Vari <> Terence Young";"Sean Connery <> Ursula Andress <> Joseph Wiseman <> Anthony Dawson <> Lois Maxwell <> Bernard Lee <> Eunice Gayson <> Jack Lord <> Zena Marshall <> John Kitzmiller <> Peter Burton <> Yvonne Shima <> Michel Mok";NULL
"2";"F7194";"8010312080203";"James Bond 007 - Monsterbox&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: Operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Al servizio segreto di sua maestà - On Her Majesty's Secret Service / Una cascata di diamanti - Diamonds Are Forever / Vivi e lascia morire - Live and Let Die / L'uomo dalla pistola d'oro - The Man with the Golden Gun / La spia che mi amava - The Spy Who Loved Me / Moonraker: Operazione spazio - Moonraker / Solo per i tuoi occhi - For Your Eyes Only / Octopussy: Operazione Piovra - Octopussy / Bersaglio mobile - A View to a Kill / Vendetta privata - Licence to Kill / Goldeneye - GoldenEye / Il domani non muore mai - Tomorrow Never Dies / Il mondo non basta - The World Is Not Enough / La morte può attendere - Die Another Day / Zona pericolo - The Living Daylights / Casino Royale - Casino Royale";"James Bond 007 - Monsterbox";"21";"james bond 007 - monsterbox&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice / al servizio se";"2008";"F0007194";"369";"1";NULL;"6";"20";"1";"4277";"Dalla Russia con amore";"From Russia with Love";"dalla russia con amore";"from russia with love";"1963";"Gran Bretagna";NULL;"Boxset";"10";"42DVD";"Vari <> Terence Young";"Sean Connery <> Robert Shaw <> Pedro Armendáriz <> Daniela Bianchi <> Lotte Lenya <> Bernard Lee <> Eunice Gayson <> Walter Gotell";NULL
"2";"F7194";"8010312080203";"James Bond 007 - Monsterbox&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: Operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Al servizio segreto di sua maestà - On Her Majesty's Secret Service / Una cascata di diamanti - Diamonds Are Forever / Vivi e lascia morire - Live and Let Die / L'uomo dalla pistola d'oro - The Man with the Golden Gun / La spia che mi amava - The Spy Who Loved Me / Moonraker: Operazione spazio - Moonraker / Solo per i tuoi occhi - For Your Eyes Only / Octopussy: Operazione Piovra - Octopussy / Bersaglio mobile - A View to a Kill / Vendetta privata - Licence to Kill / Goldeneye - GoldenEye / Il domani non muore mai - Tomorrow Never Dies / Il mondo non basta - The World Is Not Enough / La morte può attendere - Die Another Day / Zona pericolo - The Living Daylights / Casino Royale - Casino Royale";"James Bond 007 - Monsterbox";"21";"james bond 007 - monsterbox&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice / al servizio se";"2008";"F0007194";"369";"1";NULL;"6";"20";"1";"4279";"Thunderball: operazione Tuono";"Thunderball";"thunderball: operazione tuono";"thunderball";"1965";"Gran Bretagna";NULL;"Boxset";"10";"42DVD";"Vari <> Terence Young";"Sean Connery <> Adolfo Celi <> Martine Beswick <> Luciana Paluzzi <> Claudine Auger <> Guy Doleman <> Rik Van Nutter <> Lois Maxwell <> Bernard Lee <> Desmond Llewelyn <> Molly Peters";NULL
"2";"F4682";;"Sean Connery &#45; James Bond 007 Collection&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Una cascata di diamanti - Diamonds Are Forever";"Sean Connery &#45; James Bond 007 Collection";"6";"sean connery &#45; james bond 007 collection&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice";"2007";"F0004682";"106.5";"1";NULL;"6";"20";"1";"4276";"Licenza di uccidere";"Dr. No";"licenza di uccidere";"dr. no";"1962";"Gran Bretagna";NULL;"Boxset";"10";"12DVD";"Vari <> Terence Young";"Sean Connery <> Ursula Andress <> Joseph Wiseman <> Anthony Dawson <> Lois Maxwell <> Bernard Lee <> Eunice Gayson <> Jack Lord <> Zena Marshall <> John Kitzmiller <> Peter Burton <> Yvonne Shima <> Michel Mok";NULL
"2";"F4682";;"Sean Connery &#45; James Bond 007 Collection&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Una cascata di diamanti - Diamonds Are Forever";"Sean Connery &#45; James Bond 007 Collection";"6";"sean connery &#45; james bond 007 collection&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice";"2007";"F0004682";"106.5";"1";NULL;"6";"20";"1";"4277";"Dalla Russia con amore";"From Russia with Love";"dalla russia con amore";"from russia with love";"1963";"Gran Bretagna";NULL;"Boxset";"10";"12DVD";"Vari <> Terence Young";"Sean Connery <> Robert Shaw <> Pedro Armendáriz <> Daniela Bianchi <> Lotte Lenya <> Bernard Lee <> Eunice Gayson <> Walter Gotell";NULL
"2";"F4682";;"Sean Connery &#45; James Bond 007 Collection&#58; Licenza di uccidere - Dr. No / Dalla Russia con amore - From Russia with Love / Missione Goldfinger - Goldfinger / Thunderball: operazione Tuono - Thunderball / Si vive solo due volte - You Only Live Twice / Una cascata di diamanti - Diamonds Are Forever";"Sean Connery &#45; James Bond 007 Collection";"6";"sean connery &#45; james bond 007 collection&#58; licenza di uccidere - dr. no / dalla russia con amore - from russia with love / missione goldfinger - goldfinger / thunderball: operazione tuono - thunderball / si vive solo due volte - you only live twice";"2007";"F0004682";"106.5";"1";NULL;"6";"20";"1";"4279";"Thunderball: operazione Tuono";"Thunderball";"thunderball: operazione tuono";"thunderball";"1965";"Gran Bretagna";NULL;"Boxset";"10";"12DVD";"Vari <> Terence Young";"Sean Connery <> Adolfo Celi <> Martine Beswick <> Luciana Paluzzi <> Claudine Auger <> Guy Doleman <> Rik Van Nutter <> Lois Maxwell <> Bernard Lee <> Desmond Llewelyn <> Molly Peters";NULL

 

Link to comment
https://forums.phpfreaks.com/topic/221928-problem-with-regexp/#findComment-1148598
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.