Which characters need escaping list? 
Author Message
 Which characters need escaping list?

Hi there guys,

Does anyone know where I could get a list of which characters need to be
escaped out of strings when using perl. I searched on google with quite  few
combinations of words but came up empty. I'm still looking but does anyone
have any ideas?

Mucho Gracias in advance friends!
Kind regards

Simon

--
**If at first you don't succeed - destroy any evidence that you tried!**



Thu, 17 Feb 2005 16:22:44 GMT  
 Which characters need escaping list?

Quote:
> Hi there guys,

> Does anyone know where I could get a list of which characters need to be
> escaped out of strings when using perl. I searched on google with quite  few
> combinations of words but came up empty. I'm still looking but does anyone
> have any ideas?

There are different quoting contexts in Perl, and they interpret different
backslash escapes (if that is what you mean).  So a single list wouldn't
do.

Use "perldoc perlop" and look for quote-like operators for a comprehensive
description.  Also look at the quotemeta() function.  That quotes all
characters that *may* need quoting in any context, but it doesn't say
in what context (if any) the quoting is needed.

Anno



Thu, 17 Feb 2005 16:40:05 GMT  
 Which characters need escaping list?

Quote:

> Does anyone know where I could get a list of which characters need to be
> escaped out of strings when using perl. I searched on google with quite  few
> combinations of words but came up empty. I'm still looking but does anyone
> have any ideas?

either use quotemeta(), as anno said, or:
if you don't know the blacklist (which characters to escape (or even
forbid)) then use a whitelist and escape/forbid everything else.
depends on what the data is for, of course.

hth, tina
--
http://www.tinita.de         \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/      \     / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/   \    \ _,_\ __/\ __/_| /__/ perception



Thu, 17 Feb 2005 19:21:14 GMT  
 Which characters need escaping list?
If in doubt Escape.  Obviously "\d" is completely different than "d", but there are no special
meanings to escaped special characters, so you can escape every special character with a lack of
repercussions.

Regards,
David

Hi there guys,

Does anyone know where I could get a list of which characters need to be
escaped out of strings when using perl. I searched on google with quite  few
combinations of words but came up empty. I'm still looking but does anyone
have any ideas?

Mucho Gracias in advance friends!
Kind regards

Simon

--
**If at first you don't succeed - destroy any evidence that you tried!**



Sat, 19 Feb 2005 15:22:54 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Formats: Escaping Characters

2. CGI hangs due to dodgy escape character

3. problems with the \n escape character

4. Escaping cursor characters

5. Variables and escaped characters in RegExp

6. how do I retranslate escaped characters

7. regex to escape special characters

8. Striping VT100 escape characters from a file

9. Why do escape characters show when printing?

10. Automatically escape characters?

11. How to convert literal escape to ascii character?

12. backtick operator and escape characters...

 

 
Powered by phpBB® Forum Software