Re: Japanese backslash
Re: Japanese backslash
- Subject: Re: Japanese backslash
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 23 Apr 2007 16:43:42 -0400
You can't avoid occasionally needing to escape things, but using other
delimiters does cut way down on backslashitis (a.k.a. Leaning
Toothpick Syndrome or LTS, /\/\//).
Also helpful for ( do shell script "perl -e '...' ") are Perl's q*
operators, which let you use arbitrary quotation marks, too. Like
qq(...) for double-quoted strings, q(...) for single-quoted. Can
simplify things a little given that the code is such cases is already
inside a quoted string inside a quoted string to start with...
Ruby has the same feature, using % instead of the letter q. And the
fact that {...} is equivalent to a single-quoted string in Tcl is
similarly helpful.
On 4/23/07, email@hidden <email@hidden> wrote:
Good point, indeed, but not really a solution if you're working with
XML. In sed, an ampersand ("&") appearing in the replacement string is
replaced by the string matching the regular expression. The special
meaning of the ampersand can only be suppressed by preceding it by a
backslash. So if you want to replace all instances of "&" (eg. XML
ampersand) with a literal ampersand you still have to escape it.
Fabian
On 4/23/07, Steven D. Majewski <email@hidden> wrote:
for sed, it's a lot simpler to use something other than a slash as the
separator character, then you don't need to escape the slash. Example:
sed -e 's%<key>Title</key>%%g'
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden