#!/usr/bin/perl
use strict;
use warnings;

my @strings = qw( 11000110000110000000
		  110001100011000
		);

my $regex    = qr(110*);
my $repeated = qr(^$regex*$);

print " 
 Let A = /$regex/ 
       = the regex that matches two 1's followed by any 0's.
 Let B = /$repeated/ 
       = an entire string that matches any number of A's.
 Then
";
print "   $_ does " . (/$repeated/ ? '' : 'not ') . "match.\n" for @strings;


__END__

--- from http://en.wikipedia.org/wiki/Regular_expression ---

* In formal language theory

 A regular expression R or S is

  1. the empty set       {}  (0 with line thru it)  (doesn't match any string)
  2. the empty string    epsilon                    (matches empty string)
  3. a literal           a, or {a}  for some alphabeta Sigma
  4. R|S      alternation;   also written U or V or +
  5. RS       concatenation; written as small center circle or just adjacent
  6. R*       Kleene star;   0,1, or any number of elements from R

 Priority: *, concatenation, alternation, or use () to enforce grouping 

 Example:  a|b*  is  a|(b(c*))  is  {'', 'a', 'b', 'bb', 'bbb', ...}

 a+ = 1 or more 'a' chars = aa*
 a? = 0 or 1 'a' chars = (''|a)
 
=====================================

funny characters :


 empty string 0x03B5    949  ε  (small greek epsilon)
 empty set    0x00D8    216  Ø  (latin capital O with stroke)
 for all      0x2200   8704  ∀
 exists       0x2203   8707  ∃
 member       0x2208 = 8712  ∈
 subset       0x2283   8834  ⊂
 union        0x222A   8746  ∪
 cap sigma       3A2         Σ
 this will do              °

XEmacs / mule / unicode / utf-8
(1) Find hex codepoint on w3c site for unicode
(2) convert to base 10 (perl -de1 0x...) works
(3) M-x insert-ucs-character and then type base 10 codepoint
    (not all characters found or available in this font, but many.)


ISO8859-1 (Latin-1) (latin-iso8859-1)
━━┯━━━━━━━━━━━━━━━━━━━━━━━━
[00]│ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
──┼────────────────────────
0020│    ¡  ¢  £  ¤  ¥  ¦  §  ¨  ©  ª  «  ¬  ­  ®  ¯ 
0030│ °  ±  ²  ³  ´  µ  ¶  ·  ¸  ¹  º  »  ¼  ½  ¾  ¿ 
0040│ À  Á  Â  Ã  Ä  Å  Æ  Ç  È  É  Ê  Ë  Ì  Í  Î  Ï 
0050│ Ð  Ñ  Ò  Ó  Ô  Õ  Ö  ×  Ø  Ù  Ú  Û  Ü  Ý  Þ  ß 
0060│ à  á  â  ã  ä  å  æ  ç  è  é  ê  ë  ì  í  î  ï 
0070│ ð  ñ  ò  ó  ô  õ  ö  ÷  ø  ù  ú  û  ü  ý  þ  ÿ 
━━┷━━━━━━━━━━━━━━━━━━━━━━━━

ISO8859-2 (Latin-2) (latin-iso8859-2)
━━┯━━━━━━━━━━━━━━━━━━━━━━━━
[00]│ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
──┼────────────────────────
0020│    Ą  ˘  Ł  ¤  Ľ  Ś  §  ¨  Š  Ş  Ť  Ź  ­  Ž  Ż 
0030│ °  ą  ˛  ł  ´  ľ  ś  ˇ  ¸  š  ş  ť  ź  ˝  ž  ż 
0040│ Ŕ  Á  Â  Ă  Ä  Ĺ  Ć  Ç  Č  É  Ę  Ë  Ě  Í  Î  Ď 
0050│ Đ  Ń  Ň  Ó  Ô  Ő  Ö  ×  Ř  Ů  Ú  Ű  Ü  Ý  Ţ  ß 
0060│ ŕ  á  â  ă  ä  ĺ  ć  ç  č  é  ę  ë  ě  í  î  ď 
0070│ đ  ń  ň  ó  ô  ő  ö  ÷  ř  ů  ú  ű  ü  ý  ţ  ˙ 
━━┷━━━━━━━━━━━━━━━━━━━━━━━━

ISO8859-7 (Greek) (greek-iso8859-7)
━━┯━━━━━━━━━━━━━━━━━━━━━━━━
[00]│ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
──┼────────────────────────
0020│    ‘  ’  £  �  �  ¦  §  ¨  ©  �  «  ¬  ­  �  ― 
0030│ °  ±  ²  ³  ΄  ΅  Ά  ·  Έ  Ή  Ί  »  Ό  ½  Ύ  Ώ 
0040│ ΐ  Α  Β  Γ  Δ  Ε  Ζ  Η  Θ  Ι  Κ  Λ  Μ  Ν  Ξ  Ο 
0050│ Π  Ρ  �  Σ  Τ  Υ  Φ  Χ  Ψ  Ω  Ϊ  Ϋ  ά  έ  ή  ί 
0060│ ΰ  α  β  γ  δ  ε  ζ  η  θ  ι  κ  λ  μ  ν  ξ  ο 
0070│ π  ρ  ς  σ  τ  υ  φ  χ  ψ  ω  ϊ  ϋ  ό  ύ  ώ  � 
━━┷━━━━━━━━━━━━━━━━━━━━━━━━

see http://www.w3.org/TR/MathML2/chapter6.html
       * www.w3.org/TR/MathML2/022.html

 natural numbers  
 Z 2124
 N 2115

