View previous topic :: View next topic |
Author |
Message |
stephang -
Joined: 17 Apr 2007 Posts: 8 Location: Germany
|
Posted: Mon Dec 07, 2009 10:42 pm Post subject: XSSI regular expression problem |
|
|
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 |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Tue Dec 08, 2009 12:36 am Post subject: |
|
|
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 |
|
|
stephang -
Joined: 17 Apr 2007 Posts: 8 Location: Germany
|
Posted: Tue Dec 08, 2009 9:09 am Post subject: |
|
|
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 |
|
|
aprelium-support -
Joined: 20 Feb 2009 Posts: 356
|
Posted: Thu Dec 10, 2009 5:59 pm Post subject: |
|
|
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 |
|
|
stephang -
Joined: 17 Apr 2007 Posts: 8 Location: Germany
|
Posted: Thu Dec 10, 2009 6:33 pm Post subject: |
|
|
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 |
|
|
stephang -
Joined: 17 Apr 2007 Posts: 8 Location: Germany
|
Posted: Thu Dec 17, 2009 6:12 pm Post subject: |
|
|
*BUMP*
Any idea anyone? |
|
Back to top |
|
|
|