aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/regex/pire/pcre2pire.h
blob: 46e45b91930a28b57db509b36af703e94169b77e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

// Author: smikler@yandex-team.ru

#include <util/generic/string.h>

/* Converts pcre regular expression to pire compatible format:
 *   - replaces "\\#" with "#"
 *   - replaces "\\=" with "="
 *   - replaces "\\:" with ":"
 *   - removes "?P<...>"
 *   - removes "?:"
 *   - removes "()" recursively
 *   - replaces "??" with "?"
 *   - replaces "*?" with "*"
 * NOTE:
 *   - Not fully tested!
 */
TString Pcre2Pire(const TString& src);