double square brackets

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

double square brackets

Postby czerny » Fri Jan 30, 2015 3:09 pm

Hallo,

I want do insert the following HTML in my article:
Code: Select all
<pre>       regex = "([[:digit:]]+)[^[:digit:]]+([[:digit:]]+)";</pre>


But it seems as if the double square brackets are treated special. What I get is:
Code: Select all
Trying to find '(

+)[^[:digit:]]+(

+)'


I have tried to use &#91; and &#93; respectively. But that doesn't help.

How can I solve this?
czerny
 
Posts: 4
Joined: Wed Jan 21, 2015 8:30 am

Re: double square brackets

Postby Harm10 » Fri Jan 30, 2015 10:57 pm

The double square brackets are used to identify the Smarty tags.
I do not know how you can circumvent them.
Maybe if you elaborate on why you want to use this type of code?
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: double square brackets

Postby czerny » Sat Jan 31, 2015 8:34 pm

This is an example for a regular expression. This is inside <pre> tags and shouldn't treated as code (or smarty tags). Maybe this is a bug in the pivotx php code?
czerny
 
Posts: 4
Joined: Wed Jan 21, 2015 8:30 am

Re: double square brackets

Postby Harm10 » Sun Feb 01, 2015 11:01 am

I am no expert on regex expressions. But to have them in the html code? Shouldn't they be in between some php tag to have the desired effect?

PivotX parses the whole content for [[ ..... ]] and interpretes them as smarty tags. So any code looking like [ .... ] will remain untouched.

For information on any way of circumventing you could ask hansfn. He is more knowledgable about the PivotX core.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: double square brackets

Postby czerny » Sun Feb 01, 2015 11:31 am

This regex should not have any effect. I only want to display it as part of some C code in <pre> tags.
czerny
 
Posts: 4
Joined: Wed Jan 21, 2015 8:30 am

Re: double square brackets

Postby Harm10 » Sun Feb 01, 2015 4:50 pm

I just remembered how to get by this problem:
Code: Select all
<pre>regex = "([[ldelim]]:digit:[[rdelim]]+)[^[:digit:[[rdelim]]+([[ldelim]]:digit:[[rdelim]]+)";</pre>

will display as
Code: Select all
regex = "([[:digit:]]+)[^[:digit:]]+([[:digit:]]+)";

The [[ldelim]] and [[rdelim]] smarty tags are meant to show only those delimiters.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: double square brackets

Postby czerny » Mon Feb 02, 2015 5:19 pm

Yes, this works! Thank you very much!
[[ldelim]] is enough in this case.
czerny
 
Posts: 4
Joined: Wed Jan 21, 2015 8:30 am

Re: double square brackets

Postby hansfn » Mon Feb 02, 2015 10:55 pm

What about using [[literal]]? Doesn't the following work?

Code: Select all
[[literal]]<pre>       regex = "([[:digit:]]+)[^[:digit:]]+([[:digit:]]+)";</pre>[[/literal]]
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Support Forum

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron