<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: add-escapes code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 13:59:00 GMT</pubDate>
    <description>DZone Snippets: add-escapes code</description>
    <item>
      <title>add-escapes - escape chars in a string</title>
      <link>http://snippets.dzone.com/posts/show/2622</link>
      <description>&lt;code&gt;&lt;br /&gt;    add-escapes: func [&lt;br /&gt;        "Insert the esc-with value before each instance of val, unless it's part of a list of things to ignore."&lt;br /&gt;        series   [string!]&lt;br /&gt;        val      [char!] "the char to escape"&lt;br /&gt;        esc-with [char!] "the char to escape it with"&lt;br /&gt;        /ignore special [block!] "block of strings to ignore"&lt;br /&gt;        /local rule=&lt;br /&gt;    ][&lt;br /&gt;        rule=: copy/deep [&lt;br /&gt;            any [&lt;br /&gt;                ; ignore rule will be added here if needed&lt;br /&gt;                mark: val (insert mark esc-with) skip&lt;br /&gt;                | skip&lt;br /&gt;            ]&lt;br /&gt;        ]&lt;br /&gt;        ; If they have things they want us to ignore, add a rule at the&lt;br /&gt;        ; beginning of the ANY rule, and a pipe symbol after it.&lt;br /&gt;        if special [&lt;br /&gt;            ; rule=/2 is the ANY block&lt;br /&gt;            ; pipe 1 is DELIMIT param&lt;br /&gt;            ; pipe 2 is new rule 'OR separator&lt;br /&gt;            insert rule=/2 reduce [delimit copy special '| '|]&lt;br /&gt;        ]&lt;br /&gt;        parse/all series rule=&lt;br /&gt;        series&lt;br /&gt;    ]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 19 Sep 2006 02:24:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2622</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
  </channel>
</rss>
