From: Norbert B. <br...@ch...> - 2003-01-16 22:12:16
|
I am not sure if my regexp is wrong (I am not very familiar with it) or = is there an bug in regular expression implementation in the switch{} = command.=20 I have this command in my view definition (test whether the field is = empty or not): {switch({text...........8})[a-zA-Z0-9]:{text...........8}:none}=20 It work well until the text...........8 contains parenthesis "(" or ")". = The switch will display "none" even if the filed is not empty (e.g. it = contains string "Pastunovia (44 %), Tadzikovia (25 %), Hazarovia (10 %), = Uzbeci (8 %)". Norbert Brazda br...@ch... tel: 0905-729359 ChangeNet - informacny servis o obcianskej spolocnosti Mlynske nivy 41, 821 09 Bratislava, Slovakia tel/fax: 02-55560026, eMail: in...@ch... http://www.changenet.sk SPAJAME LUDI, KTORI MENIA SVET |
From: Mitra <mi...@mi...> - 2003-01-16 22:27:19
|
What you are testing below should I think match anything that contains at least one alpha-numeric character (unless implemented strangely in which cae it would matche anything with EXACTLY one character). It would help with looking at this bug if you 1: Make sure you are running the latest CVS version, since there has been work with string expansion, though not specifically on "switch". 2: Set up a slice with two items, the first working - i.e. no parenthesis, the second with parenthesis. Then run the view with "debug=1" in the URL, so that we can see detailed of what exactly is getting expanded into what - and how this changes between good and bad results. - Mitra At 11:32 PM +0100 16/1/03, Norbert Brazda wrote: >I am not sure if my regexp is wrong (I am not very familiar with it) >or is there an bug in regular expression implementation in the >switch{} command. > > >I have this command in my view definition (test whether the field is >empty or not): > > {switch({text...........8})[a-zA-Z0-9]:{text...........8}:none} > >It work well until the text...........8 contains parenthesis "(" or >")". The switch will display "none" even if the filed is not empty >(e.g. it contains string "Pastunovia (44 %), Tadzikovia (25 %), >Hazarovia (10 %), Uzbeci (8 %)". > > > > > >Norbert Brazda >br...@ch... >tel: 0905-729359 > >ChangeNet - informacny servis o obcianskej spolocnosti >Mlynske nivy 41, 821 09 Bratislava, Slovakia >tel/fax: 02-55560026, eMail: in...@ch... >http://www.changenet.sk > >SPAJAME LUDI, KTORI MENIA SVET > > > > >------------------------------------------------------- >This SF.NET email is sponsored by: Thawte.com >Understand how to protect your customers personal information by implementing >SSL on your Apache Web Server. Click here to get our FREE Thawte Apache >Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en >_______________________________________________ >Apc-aa-coders mailing list >Apc...@li... >https://lists.sourceforge.net/lists/listinfo/apc-aa-coders -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... 02-6684-8096 or 0414-648-0722 Life is a Mystery to be Lived, not a Problem to be Solved |
From: Honza M. <hon...@ec...> - 2003-01-17 08:28:13
|
The regular expression for not empty field is '.+', so {switch({text...........8}).+:{text...........8}:none}=20 should work. Honza On =C8t, 2003-01-16 at 23:32, Norbert Brazda wrote: > I am not sure if my regexp is wrong (I am not very familiar with it) or= is there an bug in regular expression implementation in the switch{} com= mand.=20 >=20 >=20 > I have this command in my view definition (test whether the field is em= pty or not): >=20 > {switch({text...........8})[a-zA-Z0-9]:{text...........8}:none}=20 >=20 > It work well until the text...........8 contains parenthesis "(" or ")"= . The switch will display "none" even if the filed is not empty (e.g. it = contains string "Pastunovia (44 %), Tadzikovia (25 %), Hazarovia (10 %), = Uzbeci (8 %)". >=20 >=20 >=20 >=20 >=20 > Norbert Brazda > br...@ch... > tel: 0905-729359 >=20 > ChangeNet - informacny servis o obcianskej spolocnosti > Mlynske nivy 41, 821 09 Bratislava, Slovakia > tel/fax: 02-55560026, eMail: in...@ch... > http://www.changenet.sk >=20 > SPAJAME LUDI, KTORI MENIA SVET >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.NET email is sponsored by: Thawte.com > Understand how to protect your customers personal information by implem= enting > SSL on your Apache Web Server. Click here to get our FREE Thawte Apache= =20 > Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >=20 |
From: Norbert B. <br...@ch...> - 2003-01-17 20:12:09
|
From: "Honza Malik" <hon...@ec...> > The regular expression for not empty field is '.+', so > {switch({text...........8}).+:{text...........8}:none}=20 > should work. It seems there is some problem in the script. It tries to expand content = of the field if it contains (). Here is url to the debug information" http://www.changenet.sk/aa/view.php3?vid=3D229&cmd[229]=3Dx-229-44119&noc= ache=3D1&debug=3D1 Here is the interesting part of it: ... Expanding:1:0:'text...........8' Expanded:0:'Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), Hazarovia (10 = %), Uzbeci (8 %)' Continue = with:0:'_#HEADLINE_#FULLTEXT_#ECONOMY_{switch({text...........1})[a-zA-Z0= -9]: Politick=FD syst=E9m {text...........1} :} = {switch({loc_city.......1})[a-zA-Z0-9]: Hlavn=E9 mesto = {loc_city.......1} :} {switch({text...........2})[a-zA-Z0-9]: Rozloha = {text...........2} :} {switch({text...........3})[a-zA-Z0-9]: Po=E8et = obyvate=B5ov {text...........3} :} = {switch({text...........4})[a-zA-Z0-9]: =DAradn=FD jazyk = {text...........4} :} {switch({text...........8})[a-zA-Z0-9]: Rasov=E9 a = n=E1rodnostn=E9 zlo=BEenie Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), = Hazarovia (10 %), Uzbeci (8 %) :}' Expanding:1:0:'text...........8' Expanded:0:'Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), Hazarovia (10 = %), Uzbeci (8 %)' Continue = with:0:'_#HEADLINE_#FULLTEXT_#ECONOMY_{switch({text...........1})[a-zA-Z0= -9]: Politick=FD syst=E9m {text...........1} :} = {switch({loc_city.......1})[a-zA-Z0-9]: Hlavn=E9 mesto = {loc_city.......1} :} {switch({text...........2})[a-zA-Z0-9]: Rozloha = {text...........2} :} {switch({text...........3})[a-zA-Z0-9]: Po=E8et = obyvate=B5ov {text...........3} :} = {switch({text...........4})[a-zA-Z0-9]: =DAradn=FD jazyk = {text...........4} :} {switch(Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 = %), Hazarovia (10 %), Uzbeci (8 %))[a-zA-Z0-9]: Rasov=E9 a = n=E1rodnostn=E9 zlo=BEenie Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), = Hazarovia (10 %), Uzbeci (8 %) :} ' Expanding:1:0:'switch(Pa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), = Hazarovia (10 %), Uzbeci (8 %))[a-zA-Z0-9]:Rasov=E9 a n=E1rodnostn=E9 = zlo=BEeniePa=B9t=FAnovia (44 %), Tad=BEikovia (25 %), Hazarovia (10 %), = Uzbeci (8 %):' Expanded:0:'' Continue with:0:' ... norbert br...@ch... |