Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1156

RegexUtils - A utility class for common regex based operation

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • None
    • None
    • lang.*
    • None

    Description

      It would be nice to have a utility class for basic regex operations. Some of the features that it may contain

      • some basic regex patterns and their application methods
        • e.g a robust csv parser, or fetch keys and values from key1=value1,key2=value2. Instead of writing up regexs, one can use these utility methods
      • apply a pattern on a string
      • retrieve certain groups based on a particular criteria
      • escape certain characters in a string

      Class can look like

      RegexUtils.java
          public static final CSV_SPLITTER_REGEX = "someRobustPattern"
      
          public static final String getCsvSplitterRegex(String delimiter){
              return "delimiterSpecificPattern";
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            SaifAsif Saif Asif
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: