Hi all, i have the following thing to solve:
I want to translate something like this:
[cat]12|Text[/cat]
in
$1 = 12 (always a number)
$2 = Text (normal Text like A-Z, 0-9 and ;.-://
I have found it for a smaller one:
[cat]12[/cat]
With this i could make a special link to an detailed page with ID 12 e.g.
Now im looking for:
1. [sign] Name of a cat | Name of the link [/sign]
so pass out: ... a href = $1>$2< ...
2. [sign] /cat1/cat2/ | Name of the link [/sign]
pass out: ... a href= $1>$2< ...
Has someone a clue how to do that?
Must be something like:
Find
1. [sign]
2. $1 = everything till the |
3. $2 = everything till [/sign]
4. [/sign]
While in case
a) $1 should be only a number (Example: detailed page)
b) $1 should be a relative link to root (Example: category page)
c) $1 should be an absolute adress (like in Forum, but with a link and a linktext)
from this new things could be done like
c) with URL for target=blank or iURL for no target
and so on.
Robert
I want to translate something like this:
[cat]12|Text[/cat]
in
$1 = 12 (always a number)
$2 = Text (normal Text like A-Z, 0-9 and ;.-://
I have found it for a smaller one:
[cat]12[/cat]
Code:
$tmp=~ s,\[detail\]([\w/]+)\[/detail\],<a href="$1">$1</a>,g;With this i could make a special link to an detailed page with ID 12 e.g.
Now im looking for:
1. [sign] Name of a cat | Name of the link [/sign]
so pass out: ... a href = $1>$2< ...
2. [sign] /cat1/cat2/ | Name of the link [/sign]
pass out: ... a href= $1>$2< ...
Has someone a clue how to do that?
Must be something like:
Find
1. [sign]
2. $1 = everything till the |
3. $2 = everything till [/sign]
4. [/sign]
While in case
a) $1 should be only a number (Example: detailed page)
b) $1 should be a relative link to root (Example: category page)
c) $1 should be an absolute adress (like in Forum, but with a link and a linktext)
from this new things could be done like
c) with URL for target=blank or iURL for no target
and so on.
Robert