Class WikiPattern

java.lang.Object
org.getalp.dbnary.wiki.WikiPattern

public class WikiPattern extends Object
Created by serasset on 05/03/17.
  • Field Details

    • TEMPLATES

      public static final String TEMPLATES
    • HEADERS

      public static final String HEADERS
    • LIST_ITEMS

      public static final String LIST_ITEMS
    • RESERVED

      public static final String RESERVED
  • Constructor Details

    • WikiPattern

      public WikiPattern()
  • Method Details

    • compile

      public static Pattern compile(String regex)
      Compiles the pattern using extended syntax fit to define patterns on wiki texts.

      Summary of regular-expression extension

      Regular expression constructs, and what they match
      Construct Matches
       
      Character classes
      \p{Template} a full wiki template.
      \p{Link} either an Internal or an External Link.
      \p{ExternalLink} an External Link.
      \p{InternalLink} an Internal Link (complete with its eventual suffix).
       
      Open/Close events
      (_xxx_ the opening of an event, where xxx is identifies the event (xxx is a sequence of characters, possibly empty). If present, xxx will represent a group name (take it into account when playing with group count.
      _xxx_) the closing of an event which was given name xxx on opening. If xxx is empty, matches any closing event.
      Parameters:
      regex - The extended regular expression
      Returns:
      a Pattern matching the given extended regex.
    • toStandardPattern

      public static String toStandardPattern(String regex)