#line 268 "/home/travis/build/felix-lang/felix/src/packages/filetools.fdoc"
  var filename = System::argv 1;
  var re = System::argv 2;
  var r = System::argv 3;
  
  if System::argc != 4 do
    println$ "Usage: flx_replace filename regexp replacement";
    println$ "  replacement may contain \\1 \\2 etc for matching subgroups";
    System::exit 1;
  done
  
  
  var x = load filename;
  var cre = RE2 re;
  var result = search_and_replace (x, 0uz, cre, r);
  print result;