private static property ParserIni::$iniRegex

  1. 8.0.x lib/Drush/Make/Parser/ParserIni.php ParserIni::iniRegex
  2. 7.x lib/Drush/Make/Parser/ParserIni.php ParserIni::iniRegex
  3. master lib/Drush/Make/Parser/ParserIni.php ParserIni::iniRegex

Regex for parsing INI format.

Namespace

Drush\Make\Parser

File

lib/Drush/Make/Parser/ParserIni.php, line 15
Parser for INI format.

Class

ParserIni

Code

private static $iniRegex = '
    @^\s*                           # Start at the beginning of a line, ignoring leading whitespace
    ((?:
      [^=;\[\]]|                    # Key names cannot contain equal signs, semi-colons or square brackets,
      \[[^\[\]]*\]                  # unless they are balanced and not nested
    )+?)
    \s*=\s*                         # Key/value pairs are separated by equal signs (ignoring white-space)
    (?:
      ("(?:[^"]|(?<=\\\\)")*")|     # Double-quoted string, which may contain slash-escaped quotes/slashes
      (\'(?:[^\']|(?<=\\\\)\')*\')| # Single-quoted string, which may contain slash-escaped quotes/slashes
      ([^\r\n]*?)                   # Non-quoted string
    )\s*$                           # Stop at the next end of a line, ignoring trailing whitespace
    @msx';