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