Index: src/main/java/org/xwiki/eclipse/ui/editors/Constants.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/Constants.java	(revision 25347)
+++ src/main/java/org/xwiki/eclipse/ui/editors/Constants.java	(working copy)
@@ -23,7 +23,32 @@
 public class Constants
 {
     public static final String LIST_BULLET_PATTERN =
-        "\\*+ |11*\\. |1\\**\\. |a\\. |A\\. |i\\. |I\\. |g\\. |h\\. |k\\. ";
+        // Bulleted list
+        "^\\*+ |"
+        // Numbered list
+        + "^1+\\. |"
+        // Mixed list
+        + "^1+\\*+\\. |"
+        // Square list
+        + "^- |"
+        // Lowercase Alphabetical list
+        + "^a\\. |"
+        // Uppercase Roman list
+        + "^A\\. |"
+        // Lowercase Greek list
+        + "^g\\. |"
+        // Uppercase Greek list
+        + "^G\\. |"
+        // Hiragana list
+        + "^h\\. |"
+        // Hiragana Iroah list
+        + "^H\\. |"
+        // Katakana list
+        + "^k\\. |"
+        // Katakana Iroha list
+        + "^K\\. |"
+        // Hebrew list
+        + "^j\\. ";
 
     public static final String DEFINITION_TERM_PATTERN = ":*; .+|:+ .+";
 
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/Rule.java	(revision 0)
@@ -0,0 +1,109 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IRule;
+
+public abstract class Rule implements IRule
+{
+    private static final char[] LINE_SEPARATOR = System.getProperty("line.separator").toCharArray();
+
+    protected StringBuffer readLeadingSpaces(ICharacterScanner scanner)
+    {
+        StringBuffer spaces = new StringBuffer();
+
+        int c;
+        while ((c = scanner.read()) != ICharacterScanner.EOF && isSpace(c)) {
+            spaces.append((char) c);
+        }
+
+        // Rewind the last character. Maybe EOF or a space.
+        scanner.unread();
+        return spaces;
+    }
+
+    private boolean isSpace(int c)
+    {
+        return ((char) c) == ' ' || ((char) c) == '\t';
+    }
+
+    protected StringBuffer readWord(ICharacterScanner scanner)
+    {
+        StringBuffer word = new StringBuffer();
+
+        int c;
+        while ((c = scanner.read()) != ICharacterScanner.EOF) {
+            word.append((char) c);
+
+            if (Character.isWhitespace(c)) {
+                return word;
+            }
+        }
+
+        // Rewind the EOF.
+        scanner.unread();
+        return word;
+    }
+
+    protected StringBuffer readLine(ICharacterScanner scanner)
+    {
+        StringBuffer line = new StringBuffer();
+
+        do {
+            char[] separator = readLineSeparatorIfPresent(scanner);
+            if (separator != null) {
+                line.append(separator);
+                return line;
+            }
+
+            int c = scanner.read();
+            if (c == ICharacterScanner.EOF) {
+                break;
+            }
+
+            line.append((char) c);
+        } while (true);
+
+        // Rewind EOF.
+        scanner.unread();
+        return line;
+    }
+
+    private char[] readLineSeparatorIfPresent(ICharacterScanner scanner)
+    {
+        for (int n = 0; n < LINE_SEPARATOR.length; n++) {
+            if (LINE_SEPARATOR[n] != (char) scanner.read()) {
+                unread(scanner, n + 1);
+                return null;
+            }
+        }
+        return LINE_SEPARATOR;
+    }
+
+    protected void unread(ICharacterScanner scanner, int count)
+    {
+        for (int n = 0; n < count; n++) {
+            scanner.unread();
+        }
+    }
+
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/ListRule.java	(revision 0)
@@ -0,0 +1,66 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+public class ListRule extends Rule
+{
+    private Pattern pattern;
+    private IToken token;
+
+    public ListRule(String regex, IToken token)
+    {
+        this.pattern = Pattern.compile(regex);
+        this.token = token;
+    }
+
+    public IToken evaluate(ICharacterScanner scanner)
+    {
+        if (scanner.getColumn() != 0) {
+            return Token.UNDEFINED;
+        }
+
+        // Consume all leading spaces.
+        StringBuffer spaces = readLeadingSpaces(scanner);
+
+        // Consume the first word.
+        StringBuffer text = new StringBuffer();
+        text.append(readWord(scanner));
+
+        // Is there a list?
+        Matcher matcher = pattern.matcher(text);
+        if (matcher.lookingAt()) {
+            // Yes.
+            return token;
+        }
+
+        // There is no list. Rewind the scanner.
+        unread(scanner, spaces.length() + text.length());
+        return Token.UNDEFINED;
+    }
+
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeadlineRule.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeadlineRule.java	(revision 0)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/rules/HeadlineRule.java	(revision 0)
@@ -0,0 +1,77 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ */
+package org.xwiki.eclipse.ui.editors.scanners.rules;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+public class HeadlineRule extends Rule
+{
+    private Map<Pattern, IToken> patternToken = new LinkedHashMap<Pattern, IToken>();
+
+    public IToken evaluate(ICharacterScanner scanner)
+    {
+        if (scanner.getColumn() != 0) {
+            return Token.UNDEFINED;
+        }
+
+        // Consume all leading spaces.
+        StringBuffer spaces = readLeadingSpaces(scanner);
+
+        // Consume the first two words.
+        StringBuffer text = new StringBuffer();
+        text.append(readWord(scanner));
+        text.append(readWord(scanner));
+
+        Iterator<Pattern> patterns = patternToken.keySet().iterator();
+        while (patterns.hasNext()) {
+            Pattern pattern = patterns.next();
+            if (pattern == null) {
+                continue;
+            }
+
+            // Is there a headline?
+            Matcher matcher = pattern.matcher(text);
+            if (matcher.lookingAt()) {
+                // Yes. Consume the rest of the line.
+                readLine(scanner);
+                return patternToken.get(pattern);
+            }
+        }
+
+        // There is no headline. Rewind the scanner.
+        unread(scanner, spaces.length() + text.length());
+        return Token.UNDEFINED;
+    }
+
+    public void add(String regex, IToken token)
+    {
+        patternToken.put(Pattern.compile(regex), token);
+    }
+
+}
Index: src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java
===================================================================
--- src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java	(revision 25347)
+++ src/main/java/org/xwiki/eclipse/ui/editors/scanners/XWikiMarkupScanner.java	(working copy)
@@ -31,7 +31,8 @@
 import org.xwiki.eclipse.ui.editors.Constants;
 import org.xwiki.eclipse.ui.editors.Preferences;
 import org.xwiki.eclipse.ui.editors.scanners.rules.BalancedParenthesisRule;
-import org.xwiki.eclipse.ui.editors.scanners.rules.RegExRule;
+import org.xwiki.eclipse.ui.editors.scanners.rules.HeadlineRule;
+import org.xwiki.eclipse.ui.editors.scanners.rules.ListRule;
 
 public class XWikiMarkupScanner extends RuleBasedScanner
 {
@@ -63,62 +64,16 @@
 
         List<IRule> rules = new ArrayList<IRule>();
 
-        /* RegEx rules work better with respect to SingleLineRules */
-        RegExRule regExRule = new RegExRule("1 .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("= .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1 .*\n?", heading2Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1 .*\n?", heading3Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("=== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1 .*\n?", heading4Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("==== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1.1 .*\n?", heading5Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("===== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule("1.1.1.1.1.1 .*\n?", heading6Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
+        HeadlineRule headlines = new HeadlineRule();
+        headlines.add("^= .|^1 .", heading1Token);
+        headlines.add("^== .|^1\\.1 .", heading2Token);
+        headlines.add("^=== .|^1\\.1\\.1 .", heading3Token);
+        headlines.add("^==== .|^1\\.1\\.1\\.1 .", heading4Token);
+        headlines.add("^===== .|^1\\.1\\.1\\.1\\.1 .", heading5Token);
+        headlines.add("^====== .|^1\\.1\\.1\\.1\\.1 .", heading6Token);
+        rules.add(headlines);
 
-        regExRule = new RegExRule("====== .*\n?", heading1Token);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule(Constants.LIST_BULLET_PATTERN, listBulletToken);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
-
-        regExRule = new RegExRule(Constants.DEFINITION_TERM_PATTERN, definitionTermToken);
-        regExRule.setColumnConstraint(0);
-        rules.add(regExRule);
+        rules.add(new ListRule(Constants.LIST_BULLET_PATTERN, listBulletToken));
 
         rules.add(new SingleLineRule("**", "**", boldToken, '\\'));
         rules.add(new SingleLineRule("*", "*", boldToken, '\\'));
