Uses a regular expression to extract a key
and value from the line.

@param {string} line
@returns {{key: undefined, value: undefined}}
8613
function extractKeyValue (line) {
  var kv = {
    key: undefined,
    value: undefined,
  };

  var matches = kvRE.exec(line);
  if (matches !== null && matches.length === 3) {
    kv.key = matches[1];
    kv.value = matches[2];
  }

  return kv;
}
868033
def _parse_param_line(self, line):
        
        value = line.strip('\n \t')
        if len(value) > 0:
            i = Input()
            if value.find('#') != -1:
                value, extra_attributes = value.split('#')
                try:
                    extra_attributes = eval(extra_attributes)
                except SyntaxError:
                    raise InputException("Incorrectly formatted input for {0}!".format(value))
                if not isinstance(extra_attributes, dict):
                    raise InputException("Incorrectly formatted input for {0}!".format(value))
                if 'prompt' in extra_attributes:
                    i.prompt = extra_attributes['prompt']
                if 'help' in extra_attributes:
                    i.help = extra_attributes['help']
                if 'type' in extra_attributes:
                    i.in_type = extra_attributes['type']
                    if i.in_type.find('/') != -1:
                        i.in_type, i.out_type = i.in_type.split('/')
                if 'cast' in extra_attributes:
                    i.out_type = extra_attributes['cast']
            if value.find('==') != -1:
                value, default = value.split('==')
                i.default = default
            if value.endswith('?'):
                value = value[:-1]
                i.is_secret = True
            return (value, i)
        return None
180027
function splitIniLine(line) {
  var separator = line.indexOf('=');
  if (separator === -1) {
    return [line];
  }
  return [
    line.substr(0, separator),
    line.substr(separator + 1)
  ];
}
604083
def parse_line(match)
        raise InvalidFormat.new "Couldn't parse plugin" if match.nil?
        Derelict::Plugin.new *match.captures[0..1]
      end
1019304
function (line) {
    var pieces = line.split(' ')

    // Header string pieces
    var output = {
      version: pieces.shift(),
      status: parseFloat(pieces.shift()),
      statusText: pieces.join(' ')
    }

    return output
  }
418054
def parse(self, line, **options):
        
        line = line.strip()
        if not line:
            return (False, (), {})
        split = line.split()
        cmd, args = split[0], split[1:]
        return (cmd, args, {})
783678
public static function extract($line)
    {
        $e = explode(': ', $line, 2);
        $header = strtolower(trim($e[0]));
        $value = isset($e[1]) ? trim($e[1]) : null;
        $safe = false;

        foreach (self::$safeCaseValues as $item) {
            if (strncasecmp($header, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
            if (strncasecmp($value, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
        }

        if (!$safe) {
            $value = strtolower($value);
        }

        return [$header, $value];
    }
894421
function (line, block) {
    if (!block.template) {
        return;
    }

    var regex = getRegExp(block.template);
    var match = regex.exec(line);
    return match ? match[1] : match;
}
497929
protected boolean isLevelLine(String line) {
        final Matcher matcher = LEVEL_PATTERN.matcher(line.trim().toUpperCase(Locale.ENGLISH));
        return matcher.find();
    }
930692
function (line) {
		line = line || "";
		line = line.trim();

		if (line.length === 0) {
			return true;
		}

		return false;
	}
1061822
function buildProperty(line) {
    var key = String(line).match("<key>(.*)</key>");
    var value = String(line).match("<integer>(.*)</integer>");
    if (!value)
        value = String(line).match("<date>(.*)</date>");
    if (!value)
        value = String(line).match("<string>(.*)</string>");
    var k = '';
    if (key != null && key.length > 1)
        k = key[1];
    var v = '';
    if (value != null && value.length > 1)
        v = value[1];
    var o = {};
    o[k] = v;
    return o;
}
419372
function parseStartKey(key, restOfLine) {
        // When a new key is encountered, the rest of the line is immediately added as
        // its value, by calling `flushBuffer`.
        flushBuffer();

        incrementArrayElement(key);

        if (stackScope && stackScope.flags.indexOf('+') > -1) key = 'value';

        bufferKey = key;
        bufferString = restOfLine;

        flushBufferInto(key, { replace: true });
      }
878216
def parse_line(self, line):
        

        # Skip blanks
        if line == '':
            return

        # Skip comments
        if regex_comment.search(line):
            return

        # Special case / header: parse global parameters into metadata
        global_parameters = regex_global.search(line)
        if global_parameters:
            self.parse_global_meta(global_parameters.group('parameters'))
            return

        # Tries to check the validity of the line.
        crtf_line = regex_line.search(line)
        if crtf_line:
            # Tries to parse the line.

            # Finds info about the region.
            region = regex_region.search(crtf_line.group('region'))
            type_ = region.group('type') or 'reg'
            include = region.group('include') or '+'
            region_type = region.group('regiontype').lower()
            if region_type in self.valid_definition:
                helper = CRTFRegionParser(self.global_meta, include, type_, region_type,
                                          *crtf_line.group('region', 'parameters'))
                self.shapes.append(helper.shape)
            else:
                self._raise_error("Not a valid CRTF Region type: '{0}'.".format(region_type))

        else:
            self._raise_error("Not a valid CRTF line: '{0}'.".format(line))
            return
365509
function parse(str) {

    let res = {};

    str.split(constants.REGEX.newline).map(line => {

        line = line.trim();

        // ignore empty lines and comments
        if (!line || line[0] === '#') {
            return;
        }

        // replace variables that are not escaped
        line = line.replace(constants.REGEX.args, (match, $1, $2) => {

            let key = $1 !== undefined ? $1 : $2;

            if (match.slice(0, 2) === '\\\\') {
                return match.slice(2);
            }

            return process.env[key] !== undefined ? process.env[key] : res[key];

        });

        // find the line split index based on the first occurence of = sign
        let index = line.indexOf('=') > -1 ? line.indexOf('=') : line.length;

        // get key/val and trim whitespace
        let key = line.slice(0, index).trim();
        let val = line.slice(index +1).trim();

        val = parseComment(val).replace(constants.REGEX.quotes, '');

        res[key] = unescape(val);

    });

    return res;

}
344693
protected static String parseValue (String line)
    {
        int eidx = line.indexOf("=");
        return (eidx == -1) ? "" : line.substring(eidx+1).trim();
    }
1164986
function parse_attribs(line) {
    var attributes = {},
        l = line.length,
        i, c,
        count = 1,
        quote = false,
        skip = false,
        open, close, joiner, seperator,
        pair = {
          start: 1,
          middle: null,
          end: null
        };

    if (!(l > 0 && (line.charAt(0) === '{' || line.charAt(0) === '('))) {
      return {
        content: line[0] === ' ' ? line.substr(1, l) : line
      };
    }
    open = line.charAt(0);
    close = (open === '{') ? '}' : ')';
    joiner = (open === '{') ? ':' : '=';
    seperator = (open === '{') ? ',' : ' ';

    function process_pair() {
      if (typeof pair.start === 'number' &&
          typeof pair.middle === 'number' &&
          typeof pair.end === 'number') {
        var key = line.substr(pair.start, pair.middle - pair.start).trim(),
            value = line.substr(pair.middle + 1, pair.end - pair.middle - 1).trim();
        attributes[key] = value;
      }
      pair = {
        start: null,
        middle: null,
        end: null
      };
    }

    for (i = 1; count > 0; i += 1) {

      // If we reach the end of the line, then there is a problem
      if (i > l) {
        throw "Malformed attribute block";
      }

      c = line.charAt(i);
      if (skip) {
        skip = false;
      } else {
        if (quote) {
          if (c === '\\') {
            skip = true;
          }
          if (c === quote) {
            quote = false;
          }
        } else {
          if (c === '"' || c === "'") {
            quote = c;
          }

          if (count === 1) {
            if (c === joiner) {
              pair.middle = i;
            }
            if (c === seperator || c === close) {
              pair.end = i;
              process_pair();
              if (c === seperator) {
                pair.start = i + 1;
              }
            }
          }

          if (c === open) {
            count += 1;
          }
          if (c === close) {
            count -= 1;
          }
        }
      }
    }
    attributes.content = line.substr(i, line.length);
    return attributes;
  }
3351
def extract_key_value(line, environ):
    
    segments = line.split("=", 1)
    if len(segments) < 2:
        return None
    key, value = segments
    # foo passes through as-is (with spaces stripped)
    # '{foo}' passes through literally
    # "{foo}" substitutes from environ's foo
    value = value.strip()
    if value[0] == "'" and _SQUOTE_RE.match(value):
        value = value[1:-1]
    elif value[0] == '"' and _DQUOTE_RE.match(value):
        template = value[1:-1]
        value = template.format(**environ)
    key = key.strip()
    value = value.strip()
    return key, value