Note:

You are viewing a development version of the library. Goto the latest version.

let split_optional_parentheses str =
  try
    let beg_str, end_str = split (trim str) '(' in
    let content_str = strip_ends_with ~what:")" end_str in
      trim beg_str,
      Some (trim content_str)
  with Not_found ->
    trim str, None