about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--posix/TESTS159
-rw-r--r--posix/TESTS2C.sed2
-rw-r--r--posix/runtests.c132
-rw-r--r--posix/testcases.h159
4 files changed, 452 insertions, 0 deletions
diff --git a/posix/TESTS b/posix/TESTS
new file mode 100644
index 0000000000..2bb7c93446
--- /dev/null
+++ b/posix/TESTS
@@ -0,0 +1,159 @@
+0:(.*)*\1:xx
+0:^:
+0:$:
+0:^$:
+0:^a$:a
+0:abc:abc
+1:abc:xbc
+1:abc:axc
+1:abc:abx
+0:abc:xabcy
+0:abc:ababc
+0:ab*c:abc
+0:ab*bc:abc
+0:ab*bc:abbc
+0:ab*bc:abbbbc
+0:ab+bc:abbc
+1:ab+bc:abc
+1:ab+bc:abq
+0:ab+bc:abbbbc
+0:ab?bc:abbc
+0:ab?bc:abc
+1:ab?bc:abbbbc
+0:ab?c:abc
+0:^abc$:abc
+1:^abc$:abcc
+0:^abc:abcc
+1:^abc$:aabc
+0:abc$:aabc
+0:^:abc
+0:$:abc
+0:a.c:abc
+0:a.c:axc
+0:a.*c:axyzc
+1:a.*c:axyzd
+1:a[bc]d:abc
+0:a[bc]d:abd
+1:a[b-d]e:abd
+0:a[b-d]e:ace
+0:a[b-d]:aac
+0:a[-b]:a-
+0:a[b-]:a-
+1:a[b-a]:-
+2:a[]b:-
+2:a[:-
+0:a]:a]
+0:a[]]b:a]b
+0:a[^bc]d:aed
+1:a[^bc]d:abd
+0:a[^-b]c:adc
+1:a[^-b]c:a-c
+1:a[^]b]c:a]c
+0:a[^]b]c:adc
+0:ab|cd:abc
+0:ab|cd:abcd
+0:()ef:def
+0:()*:-
+1:*a:-
+0:^*:-
+0:$*:-
+1:(*)b:-
+1:$b:b
+2:a\:-
+0:a\(b:a(b
+0:a\(*b:ab
+0:a\(*b:a((b
+1:a\x:a\x
+1:abc):-
+2:(abc:-
+0:((a)):abc
+0:(a)b(c):abc
+0:a+b+c:aabbabc
+0:a**:-
+0:a*?:-
+0:(a*)*:-
+0:(a*)+:-
+0:(a|)*:-
+0:(a*|b)*:-
+0:(a+|b)*:ab
+0:(a+|b)+:ab
+0:(a+|b)?:ab
+0:[^ab]*:cde
+0:(^)*:-
+0:(ab|)*:-
+2:)(:-
+1:abc:
+1:abc:
+0:a*:
+0:([abc])*d:abbbcd
+0:([abc])*bcd:abcd
+0:a|b|c|d|e:e
+0:(a|b|c|d|e)f:ef
+0:((a*|b))*:-
+0:abcd*efg:abcdefg
+0:ab*:xabyabbbz
+0:ab*:xayabbbz
+0:(ab|cd)e:abcde
+0:[abhgefdc]ij:hij
+1:^(ab|cd)e:abcde
+0:(abc|)ef:abcdef
+0:(a|b)c*d:abcd
+0:(ab|ab*)bc:abc
+0:a([bc]*)c*:abc
+0:a([bc]*)(c*d):abcd
+0:a([bc]+)(c*d):abcd
+0:a([bc]*)(c+d):abcd
+0:a[bcd]*dcdcde:adcdcde
+1:a[bcd]+dcdcde:adcdcde
+0:(ab|a)b*c:abc
+0:((a)(b)c)(d):abcd
+0:[A-Za-z_][A-Za-z0-9_]*:alpha
+0:^a(bc+|b[eh])g|.h$:abh
+0:(bc+d$|ef*g.|h?i(j|k)):effgz
+0:(bc+d$|ef*g.|h?i(j|k)):ij
+1:(bc+d$|ef*g.|h?i(j|k)):effg
+1:(bc+d$|ef*g.|h?i(j|k)):bcdd
+0:(bc+d$|ef*g.|h?i(j|k)):reffgz
+1:((((((((((a)))))))))):-
+0:(((((((((a))))))))):a
+1:multiple words of text:uh-uh
+0:multiple words:multiple words, yeah
+0:(.*)c(.*):abcde
+1:\((.*),:(.*)\)
+1:[k]:ab
+0:abcd:abcd
+0:a(bc)d:abcd
+0:a[-]?c:ac
+0:(....).*\1:beriberi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Qaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mo'ammar Gadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Kaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Qadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar El Kadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Gadafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qadafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamer El Kazzafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar al-Gaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Al Qathafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Al Qathafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mo'ammar el-Gadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar El Kadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar al-Qadhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qadhdhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Qadafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moamar Gaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar Qadhdhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Khaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar al-Khaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'amar al-Kadafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghaddafy
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghadafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Ghaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muamar Kaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Quathafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muammar Gheddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Muamar Al-Kaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar Khadafy 
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Moammar Qudhafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mu'ammar al-Qaddafi
+0:M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]:Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi
diff --git a/posix/TESTS2C.sed b/posix/TESTS2C.sed
new file mode 100644
index 0000000000..28dd131dac
--- /dev/null
+++ b/posix/TESTS2C.sed
@@ -0,0 +1,2 @@
+s/\\/\\\\/g
+s/\(.*\):\(.*\):\(.*\)/  {\1, "\2", "\3"},/
diff --git a/posix/runtests.c b/posix/runtests.c
new file mode 100644
index 0000000000..b6a292e6f5
--- /dev/null
+++ b/posix/runtests.c
@@ -0,0 +1,132 @@
+/***********************************************************
+
+Copyright 1995 by Tom Lord
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of the copyright holder not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+Tom Lord DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL TOM LORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+
+
+#include <sys/types.h>
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+
+struct a_test
+{
+  int expected;
+  const char * pattern;
+  const unsigned char * data;
+};
+
+static const struct a_test the_tests[] = 
+{
+#include "testcases.h"
+  {-1, 0, 0}
+};
+
+
+
+
+int
+run_a_test (int id, const struct a_test * t)
+{
+  static const char * last_pattern = 0;
+  static regex_t r;
+  int err;
+  char errmsg[100];
+  int x;
+  regmatch_t regs[10];
+
+  if (!last_pattern || strcmp (last_pattern, t->pattern))
+    {
+      if (last_pattern)
+	regfree (&r);
+      last_pattern = t->pattern;
+      err = regcomp (&r, t->pattern, REG_EXTENDED);
+      if (err)
+	{
+	  if (t->expected)
+	    {
+	      puts (" OK.");
+	      return 0;
+	    }
+	  regerror (err, &r, errmsg, 100);
+	  printf ("test %d\n", id);
+	  puts (errmsg);
+	  return 1;
+	}
+    }
+      
+  err = regexec (&r, t->data, 10, regs, 0);
+
+  if (err != t->expected)
+    {
+      printf ("test %d\n", id);
+      printf ("pattern \"%s\" data \"%s\" wanted %d got %d\n",
+	      t->pattern, t->data, t->expected, err);
+      for (x = 0; x < 10; ++x)
+	printf ("reg %d == (%d, %d) %.*s\n",
+		x,
+		regs[x].rm_so,
+		regs[x].rm_eo,
+		regs[x].rm_eo - regs[x].rm_so,
+		t->data + regs[x].rm_so);
+      return 1;
+    }
+  puts (" OK.");
+  return 0;
+}
+
+
+
+int
+main (int argc, char * argv[])
+{
+  int x;
+  int lo;
+  int hi;
+  int res = 0;
+
+  lo = 0;
+  hi = (sizeof (the_tests) / sizeof (the_tests[0])) - 1;
+
+  if (argc > 1)
+    {
+      lo = atoi (argv[1]);
+      hi = lo + 1;
+
+      if (argc > 2)
+	hi = atoi (argv[2]);
+    }
+
+  for (x = lo; x < hi; ++x)
+    {
+      printf ("#%d:", x);
+      res |= run_a_test (x, &the_tests[x]);
+    }
+  {
+    exit (0);
+  }
+}
+
+
diff --git a/posix/testcases.h b/posix/testcases.h
new file mode 100644
index 0000000000..c471ca0613
--- /dev/null
+++ b/posix/testcases.h
@@ -0,0 +1,159 @@
+  {0, "(.*)*\\1", "xx"},
+  {0, "^", ""},
+  {0, "$", ""},
+  {0, "^$", ""},
+  {0, "^a$", "a"},
+  {0, "abc", "abc"},
+  {1, "abc", "xbc"},
+  {1, "abc", "axc"},
+  {1, "abc", "abx"},
+  {0, "abc", "xabcy"},
+  {0, "abc", "ababc"},
+  {0, "ab*c", "abc"},
+  {0, "ab*bc", "abc"},
+  {0, "ab*bc", "abbc"},
+  {0, "ab*bc", "abbbbc"},
+  {0, "ab+bc", "abbc"},
+  {1, "ab+bc", "abc"},
+  {1, "ab+bc", "abq"},
+  {0, "ab+bc", "abbbbc"},
+  {0, "ab?bc", "abbc"},
+  {0, "ab?bc", "abc"},
+  {1, "ab?bc", "abbbbc"},
+  {0, "ab?c", "abc"},
+  {0, "^abc$", "abc"},
+  {1, "^abc$", "abcc"},
+  {0, "^abc", "abcc"},
+  {1, "^abc$", "aabc"},
+  {0, "abc$", "aabc"},
+  {0, "^", "abc"},
+  {0, "$", "abc"},
+  {0, "a.c", "abc"},
+  {0, "a.c", "axc"},
+  {0, "a.*c", "axyzc"},
+  {1, "a.*c", "axyzd"},
+  {1, "a[bc]d", "abc"},
+  {0, "a[bc]d", "abd"},
+  {1, "a[b-d]e", "abd"},
+  {0, "a[b-d]e", "ace"},
+  {0, "a[b-d]", "aac"},
+  {0, "a[-b]", "a-"},
+  {0, "a[b-]", "a-"},
+  {1, "a[b-a]", "-"},
+  {2, "a[]b", "-"},
+  {2, "a[", "-"},
+  {0, "a]", "a]"},
+  {0, "a[]]b", "a]b"},
+  {0, "a[^bc]d", "aed"},
+  {1, "a[^bc]d", "abd"},
+  {0, "a[^-b]c", "adc"},
+  {1, "a[^-b]c", "a-c"},
+  {1, "a[^]b]c", "a]c"},
+  {0, "a[^]b]c", "adc"},
+  {0, "ab|cd", "abc"},
+  {0, "ab|cd", "abcd"},
+  {0, "()ef", "def"},
+  {0, "()*", "-"},
+  {1, "*a", "-"},
+  {0, "^*", "-"},
+  {0, "$*", "-"},
+  {1, "(*)b", "-"},
+  {1, "$b", "b"},
+  {2, "a\\", "-"},
+  {0, "a\\(b", "a(b"},
+  {0, "a\\(*b", "ab"},
+  {0, "a\\(*b", "a((b"},
+  {1, "a\\x", "a\\x"},
+  {1, "abc)", "-"},
+  {2, "(abc", "-"},
+  {0, "((a))", "abc"},
+  {0, "(a)b(c)", "abc"},
+  {0, "a+b+c", "aabbabc"},
+  {0, "a**", "-"},
+  {0, "a*?", "-"},
+  {0, "(a*)*", "-"},
+  {0, "(a*)+", "-"},
+  {0, "(a|)*", "-"},
+  {0, "(a*|b)*", "-"},
+  {0, "(a+|b)*", "ab"},
+  {0, "(a+|b)+", "ab"},
+  {0, "(a+|b)?", "ab"},
+  {0, "[^ab]*", "cde"},
+  {0, "(^)*", "-"},
+  {0, "(ab|)*", "-"},
+  {2, ")(", "-"},
+  {1, "abc", ""},
+  {1, "abc", ""},
+  {0, "a*", ""},
+  {0, "([abc])*d", "abbbcd"},
+  {0, "([abc])*bcd", "abcd"},
+  {0, "a|b|c|d|e", "e"},
+  {0, "(a|b|c|d|e)f", "ef"},
+  {0, "((a*|b))*", "-"},
+  {0, "abcd*efg", "abcdefg"},
+  {0, "ab*", "xabyabbbz"},
+  {0, "ab*", "xayabbbz"},
+  {0, "(ab|cd)e", "abcde"},
+  {0, "[abhgefdc]ij", "hij"},
+  {1, "^(ab|cd)e", "abcde"},
+  {0, "(abc|)ef", "abcdef"},
+  {0, "(a|b)c*d", "abcd"},
+  {0, "(ab|ab*)bc", "abc"},
+  {0, "a([bc]*)c*", "abc"},
+  {0, "a([bc]*)(c*d)", "abcd"},
+  {0, "a([bc]+)(c*d)", "abcd"},
+  {0, "a([bc]*)(c+d)", "abcd"},
+  {0, "a[bcd]*dcdcde", "adcdcde"},
+  {1, "a[bcd]+dcdcde", "adcdcde"},
+  {0, "(ab|a)b*c", "abc"},
+  {0, "((a)(b)c)(d)", "abcd"},
+  {0, "[A-Za-z_][A-Za-z0-9_]*", "alpha"},
+  {0, "^a(bc+|b[eh])g|.h$", "abh"},
+  {0, "(bc+d$|ef*g.|h?i(j|k))", "effgz"},
+  {0, "(bc+d$|ef*g.|h?i(j|k))", "ij"},
+  {1, "(bc+d$|ef*g.|h?i(j|k))", "effg"},
+  {1, "(bc+d$|ef*g.|h?i(j|k))", "bcdd"},
+  {0, "(bc+d$|ef*g.|h?i(j|k))", "reffgz"},
+  {1, "((((((((((a))))))))))", "-"},
+  {0, "(((((((((a)))))))))", "a"},
+  {1, "multiple words of text", "uh-uh"},
+  {0, "multiple words", "multiple words, yeah"},
+  {0, "(.*)c(.*)", "abcde"},
+  {1, "\\((.*),", "(.*)\\)"},
+  {1, "[k]", "ab"},
+  {0, "abcd", "abcd"},
+  {0, "a(bc)d", "abcd"},
+  {0, "a[-]?c", "ac"},
+  {0, "(....).*\\1", "beriberi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Qaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mo'ammar Gadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Kaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Qadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar El Kadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Gadafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qadafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamer El Kazzafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar al-Gaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Al Qathafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Al Qathafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mo'ammar el-Gadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar El Kadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar al-Qadhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qadhdhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Qadafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moamar Gaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar Qadhdhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Khaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar al-Khaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'amar al-Kadafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghaddafy"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghadafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Ghaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muamar Kaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Quathafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muammar Gheddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Muamar Al-Kaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar Khadafy "},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Moammar Qudhafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mu'ammar al-Qaddafi"},
+  {0, "M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy]", "Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi"},