Search Engine Optimization > Webmaster World > \n \r \t
\n \r \t
Posted by Duende on January 11th, 2006

Greets all

Ok, I know what \n & \r are but what is \t and are there any others that I
should know?

--
D?

Posted by GreyWyvern on January 11th, 2006

And lo, Duende didst speak in alt.www.webmaster:

\t is tab. If you're just talking about characters which represent
white-space, there aren't really any others which are so widely used. I
heard there was one for \x160 or the   but I could be mistaken.

Other than whitespace, usually \\ is a single backslash, and \' and \" are
their respective quotes. Different programming languages implement many
more escaped special characters depending on their syntax. PHP, for
example, allows you to insert a dollar sign by \$ in case it is followed
by text which could be interpreted as a variable name. For instance:

$foo = "bar";
echo "$foo \$foo";

Would output:

bar $foo


Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- http://www.greywyvern.com/orca#sear - Orca Search - PHP/MySQL site
search engine

Posted by Mark Parnell on January 11th, 2006

Deciding to do something for the good of humanity, Duende
<myusenet@sify.com> spouted in alt.www.webmaster:

G'day.

A tab.

For what purpose? In PHP for example, AFAIK the only other one that is
predefined is \0 (null). Some other languages have several additional
escape sequences defined as well.

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/

Posted by Duende on January 11th, 2006

On 10 Jan 2006 Mark Parnell wrote in alt.www.webmaster


For what purpose I really don't know, yet. I am doing php stuff.

Thank you.

--
D?

Posted by Duende on January 11th, 2006

On 10 Jan 2006 GreyWyvern wrote in alt.www.webmaster

I was just woundering as \t was something I hadn't seen in PHP before.

--
D?

Posted by Steve Sobol on January 11th, 2006

Duende wrote:

PHP has functions that can handle Posix-style regular expressions and
Perl-Compatible regular expressions - you have a whole 'nother can of worms
to open there

--
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307

Posted by »Q« on January 11th, 2006

Steve Sobol <sjsobol@JustThe.net> wrote in
<news:dq24qo$noe$1@ratbert.glorb.com>:

Heh. 'man pcre' lists the sequences for special characters as

\a alarm, that is, the BEL character (hex 07)
\cx "control-x", where x is any character
\e escape (hex 1B)
\f formfeed (hex 0C)
\n newline (hex 0A)
\r carriage return (hex 0D)
\t tab (hex 09)
\ddd character with octal code ddd, or backreference
\xhh character with hex code hh
\x{hhh..} character with hex code hhh... (UTF-8 mode only)

I don't do PHP, so I don't know if that helps (or hurts).

--
»Q«

Posted by Duende on January 11th, 2006

On 10 Jan 2006 »Q« wrote in alt.www.webmaster

With me every little bit helps. Thanks.

--
D?

Posted by Steve Sobol on January 12th, 2006

Duende wrote:

Those escapes should work fine with PHP, since PHP's functions are just
wrapper functions that call the PCRE library. For your further
entertainment, I offer links to documentation:

http://php.net/regex (POSIX-style regexps)
http://php.net/pcre (Perl-style regexps)



--
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307

Posted by Duende on January 12th, 2006

On 11 Jan 2006 Steve Sobol wrote in alt.www.webmaster

Thanks for the links Steve. Nothing on TV tonight so I will spend some time
reading.

--
D?

Funbolt.com - Entertainment portal, wallpapers, sexy celebs