XSSI regular expression problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
stephang
-


Joined: 17 Apr 2007
Posts: 8
Location: Germany

PostPosted: Mon Dec 07, 2009 10:42 pm    Post subject: XSSI regular expression problem Reply with quote

Dear all,

I am trying to do some conditional html based on a query string which I am trying to take apart by using a regular expression.

the query string will have the format xxx'xxx'xxx, where xxx may be undefined length of alfanumeric or "-", separated by "'".

Now the regular expression I am trying to use is

Code:
([A-Za-z0-9_]*)'([A-Za-z0-9_]*)'([A-Za-z0-9_]*)


and all regular expression builders / checkers I could find find the expression fine.
However, Abyss X1 (which I love and which I use in V2.6) tells me:

Code:

XSSI Error in directive if in line 48: Bad regular expression 'unmatched parentheses'][XSSI Error in directive if in line 48: Error at token '1234'asdf'12435asdf = /([A-Za-z0-9_]*)'([A-Za-z0-9_]*)'([A-Za-z0-9_]*)/'


And I, being quite useless at this, have no idea what it's trying to tell me.
Anyone willing to translate?
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Tue Dec 08, 2009 12:36 am    Post subject: Reply with quote

Abyss Web Server uses pattern matching for its configuration, with the exception of the URL Rewriting feature. What configuration parameter are you using? Is it an XSSI directive or part of Abyss's configuration?
Back to top View user's profile Send private message Visit poster's website
stephang
-


Joined: 17 Apr 2007
Posts: 8
Location: Germany

PostPosted: Tue Dec 08, 2009 9:09 am    Post subject: Reply with quote

Sorry for being incomplete, I hate that when people do that to me ;-)

Ok, this is is supposed to be part of an XSSI directive. I have .html configured to be parsed for XSSI, which works well for e.g. includes, which seems to indicate the server settings are ok.

In my test page I first output the QUERY_STRING variable with
Code:
QUERY_STRING = <!--#echo var="QUERY_STRING" -->

which works ok.

Then I assign the query string to a variable:
Code:
 <!--#set var="privar_query_string" value="$QUERY_STRING" -->

and output it
Code:
 PRIVAR_QUERY_STRING = <!--#echo var="PRIVAR_QUERY_STRING" -->

which also works ok.

Next I do some basic pattern matching to see if it works in prinicple:
Code:
<!--#if expr="$PRIVAR_QUERY_STRING = /^[^']+/" -->
0=<!--#echo var="0" -->
<!--#endif -->

This correctly returns the substring before the first '.

But when I get to the thing I really want to do

Code:
<!--#if expr="$PRIVAR_QUERY_STRING = /([A-Za-z0-9_]*)'([A-Za-z0-9_]*)'([A-Za-z0-9_]*)/" -->
test
<!--#endif -->



, I get this error message I don't understand.

Do I make sense now?
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Thu Dec 10, 2009 5:59 pm    Post subject: Reply with quote

stephang,

Omitting the parentheses solves the problem:

Code:
<!--#if expr="$PRIVAR_QUERY_STRING = /[A-Za-z0-9_]*'[A-Za-z0-9_]*'[A-Za-z0-9_]*/" -->
test
<!--#endif -->

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
stephang
-


Joined: 17 Apr 2007
Posts: 8
Location: Germany

PostPosted: Thu Dec 10, 2009 6:33 pm    Post subject: Reply with quote

Dear Aprelium,

Thanks for your input, but actually I wanted to do something with the three parts of the query string, use them as back references. Hence the parentheses.
If I'm not mistaken, that's not possible with your line.

Maybe my question was the wrong approach, coming from the code line.
Instead let me state what the goal is:
I want to pass three data entities to a page through the query string. In order to use them in the page for my conditions I figure I have to take the string apart first and put the three parts into separate variables.
In order to be able to take them apart I use a separator ('), can be any other character outside a-z A-z 0-1 _ which I intend to use inside my three strings. I figure ' would be ok as it doesn't carry any syntactical meaning in the regular expressions.

so the steps I wish to perform is:

- grab the query string
- take it apart into three entities separated by a certain character inside the query string and put the parts into separate variables
- use the variables for my XSSI conditions.

Any idea how to go about this?
Back to top View user's profile Send private message
stephang
-


Joined: 17 Apr 2007
Posts: 8
Location: Germany

PostPosted: Thu Dec 17, 2009 6:12 pm    Post subject: Reply with quote

*BUMP*
Any idea anyone?
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group