I am trying to come up with a regular expressions that will match against a string allowing regular letters, hyphens, unicode letters, numbers, spaces, newlines (\n or \r\n) but no punctuation of any sort.
That's fairly trivial, once you know what you want to match, and what you don't want to. You say "hyphen" but "no punctuation of any sort". But a hyphen is punctuation of some sort. And in Unicode, there are many kinds of dashes. And what do you mean by "punctuation"? Do you consider a WHITE FROWNING FACE to be punctuation? What about a SNOWMAN? As for 'letters', Unicode defines what it considers 'letters'. Does that match your idea of letters? And numbers, do you mean digits? Anything numerical? And what are "spaces" in your definition? All 20+ spaces in the Unicode standard? Probably not, because that includes all the various linelines, and you mention them explicitly.

In short, your definition of what you want to match and what you don't is too vague to do anything with. And once it's exact, writing the regexp is easy.


In reply to Re: Unicode regular expressions by JavaFan
in thread Unicode regular expressions by SilasTheMonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.