View previous topic :: View next topic |
Author |
Message |
thinkr -
Joined: 24 Oct 2013 Posts: 15 Location: California
|
Posted: Fri Nov 28, 2014 3:14 am Post subject: escaping the | symbol |
|
|
Hello, I tried using URL Redirect to redirect a bogus URL that contained a | symbol. I tried escaping the character with a backslash: \. However, the resulting \| still treats the | like an OR, not a character. How do I succeed in escaping the pipe symbol? Or is this a problem with my very old version of abyss x2 v2.8? _________________ If you don't question it then you don't know it. |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sun Nov 30, 2014 10:13 pm Post subject: |
|
|
This isn't too hard to achieve. I'm using X2 v2.8 as well.
Here's the code I used.
Virtual path regex:
It catches any URL with the pipe in it (including JUST the pipe).
_________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
Horizon -
Joined: 18 Feb 2022 Posts: 54
|
Posted: Sun Apr 24, 2022 10:30 pm Post subject: |
|
|
If anyone is still looking for how to do this, you can read this:
Quote: | \0dd character with octal code 0dd
\ddd character with octal code ddd, or back reference
\o{ddd..} character with octal code ddd..
\xhh character with hex code hh
\x{hhh..} character with hex code hhh.. (non-JavaScript mode)
\uhhhh character with hex code hhhh (JavaScript mode only) |
Quote: | (4) \u matches a lower case "u" character unless it is followed by four
hexadecimal digits, in which case the hexadecimal number defines the
code point to match. By default, \u causes a compile time error (Perl
uses it to upper case the following character). |
That means you can do this to escape the | character:
or
0x7C is the hex byte that represents the | character.
0x5C is the one for \ (if you need it).
You can use any hex editor to find the hex value for a character.
More details:
Quote: | Constraints on character values
Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so-
called "surrogate" codepoints), and 0xffef. |
|
|
Back to top |
|
|
|