original_string: public static function fromString($constraintExpression)
      {
          if (!preg_match('/^(==?|\!=?|~|[<>]=?)?((?:\*|[0-9]+)(?:.(?:\*|[0-9]+))*)(?:\@(\w+))?$/', $constraintExpression, $m)) {
              throw new \InvalidArgumentException("Constraint expression '$constraintExpression' could not be parsed");
          }
          return new self(
              !empty($m[1]) ? $m[1] : '=',
              $m[2],
              !empty($m[3]) ? $m[3] : 'stable'
          );
      }
code: public static function fromString($constraintExpression)
      {
          if (!preg_match('/^(==?|\!=?|~|[<>]=?)?((?:\*|[0-9]+)(?:.(?:\*|[0-9]+))*)(?:\@(\w+))?$/', $constraintExpression, $m)) {
              throw new \InvalidArgumentException("Constraint expression '$constraintExpression' could not be parsed");
          }
          return new self(
              !empty($m[1]) ? $m[1] : '=',
              $m[2],
              !empty($m[3]) ? $m[3] : 'stable'
          );
      }
code_tokens: public static function fromString ( $ constraintExpression ) { if ( ! preg_match ( '/^(==?|\!=?|~|[<>]=?)?((?:\*|[0-9]+)(?:.(?:\*|[0-9]+))*)(?:\@(\w+))?$/' , $ constraintExpression , $ m ) ) { throw new \ InvalidArgumentException ( "Constraint expression '$constraintExpression' could not be parsed" ) ; } return new self ( ! empty ( $ m [ 1 ] ) ? $ m [ 1 ] : '=' , $ m [ 2 ] , ! empty ( $ m [ 3 ] ) ? $ m [ 3 ] : 'stable' ) ; }
docstring: Construct a Constraint instance based on the passed string constraint.
  
  @param string $constraintExpression
  @return Constraint
  
  @throws \InvalidArgumentException
docstring_tokens: Construct a Constraint instance based on the passed string constraint .