title: What characters are allowed in common lisp symbols?
body: <p>What characters are allowed in common lisp symbols? Can you give a regular expression to match them (or are they beyond the capable of regular grammars to describe)?</p>
  
  <p>I have tried looking for information on this, but all I can find are some <a href="http://www.lispworks.com/documentation/lw70/CLHS/Body/02_cd.htm" rel="nofollow">examples</a> in CLHS, but no concrete definition of what <em>exactly</em> a legal symbol is.</p>
  
  <h1>Edit:</h1>
  
  <p>So, common lisp symbols can legally contain any character.</p>
  
  <p>However, the parser doesn't just accept any character as it reads lisp code. What are the rules for parsable symbols? E.g. symbols that can be supplied as <code>'quoted</code> symbols or inside of <code>'(quoted lists)</code>.</p>
  
  <p>I am interested in generating and reading non-bar-delimited symbols, from a non-lisp language. It should suffice, for my application, to use <code>[a-zA-Z0-9:&amp;-]+</code>, but I tend to prefer to be as accurate as possible, which is why I am trying to determine if there is a regex that can match symbols. Matching the <code>|delimited syntax|</code> would be a bonus, but non-delimited symbols would suffice.</p>
  
  <p>This needs to be symbols that would be loaded legally when using <code>(read)</code>. The answer is not that symbols can contain any character:</p>
  
  <pre><code>[1]&gt; (read t)
  #
  *** - READ from #&lt;IO TERMINAL-STREAM&gt;: objects printed as # in view of *PRINT-LEVEL* cannot be read back in
  </code></pre>
  
  <p>I want to know the rules, or a regex, for what is a valid symbol here, without delimiting it with <code>|</code>.</p>