aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/regex/pire/pcre2pire.h
blob: b4d3b34205d5ba9b1e7ac11422f2acdb4088a2f2 (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);