19 lines
483 B
C++
19 lines
483 B
C++
#pragma once
|
|
|
|
#include <regex.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace sedpp {
|
|
|
|
// Expands an s-command replacement. Besides &, \1...\9, and literal escapes,
|
|
// GNU sed supports case-conversion state such as \U...\E and one-byte \u/\l.
|
|
class Replacement {
|
|
public:
|
|
static std::string expand(const std::string &replacement,
|
|
const std::string &subject,
|
|
const std::vector<regmatch_t> &groups);
|
|
};
|
|
|
|
} // namespace sedpp
|