understanding this regex

Posted by DarthVader on Stack Overflow See other posts from Stack Overflow or by DarthVader
Published on 2011-11-19T01:40:23Z Indexed on 2011/11/19 1:50 UTC
Read the original article Hit count: 315

Filed under:
|
|

I m trying to understand what the following does.

^([^=]+)(?:(?:\\=)(.+))?$

Any ideas?

This is being used here. Obviously it s command line parser but i m trying to understand the syntax so i can actually run the program. This is from commandline-jmxclient , they have no documents on setting JMX properties but in their source code, there is such an option, so i just want to understand how i can invoke that method.

  Matcher m = Client.CMD_LINE_ARGS_PATTERN.matcher(command);
  if ((m == null) || (!m.matches())) {
    throw new ParseException("Failed parse of " + command, 0);
  }

  this.cmd = m.group(1);
  if ((m.group(2) != null) && (m.group(2).length() > 0))
    this.args = m.group(2).split(",");
  else
    this.args = null;

© Stack Overflow or respective owner

Related posts about java

Related posts about regex