ex02ChildrenInverse <- function(sentence) {
  
  matches <- regmatches(
    sentence,
    regexec('(.*?) is the (father|mother) of "(.*?)"\\.', sentence))[[1]]
    
  parent <- matches[[2]]
  male   <- matches[[3]] == "father"
  child  <- matches[[4]]
  
  return(list(parent = parent, male = male, child = child))
}
ex02ChildrenInverse('Gudrun is the mother of "Rosamunde ("Rosi")".')