libstdc++: regex Source File

libstdc++

regex
Go to the documentation of this file.
1// <regex> -*- C++ -*-
2
3// Copyright (C) 2007-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file include/regex
26 * This is a Standard C++ Library header.
27 */
28
29#ifndef _GLIBCXX_REGEX
30#define _GLIBCXX_REGEX 1
31
32#ifdef _GLIBCXX_SYSHDR
33#pragma GCC system_header
34#endif
35
36#include <bits/requires_hosted.h> // string and container heavy
37
38#if __cplusplus < 201103L
39# include <bits/c++0x_warning.h>
40#else
41
42#include <bitset>
43#include <locale>
44#include <stack>
45#include <stdexcept>
46#include <string>
47
48#include <ext/aligned_buffer.h>
49#include <ext/numeric_traits.h>
50#include <bits/shared_ptr.h>
51#include <bits/std_function.h>
52#include <bits/stl_algobase.h> // std::copy, std::fill_n
53#include <bits/stl_algo.h> // std::sort, std::unique
54#include <bits/stl_iterator_base_types.h> // std::iterator_traits
55#include <bits/stl_pair.h>
56#include <bits/stl_tree.h>
57#include <bits/stl_map.h>
58#include <bits/stl_vector.h>
59#include <bits/stl_bvector.h>
60#include <bits/vector.tcc>
61#ifdef _GLIBCXX_DEBUG
62# include <debug/vector>
63#endif
64#include <bits/regex_constants.h>
65#include <bits/regex_error.h>
66#include <bits/regex_automaton.h>
67#include <bits/regex_scanner.h>
68#include <bits/regex_compiler.h>
69#include <bits/regex.h>
70#include <bits/regex_executor.h>
71
72#define __glibcxx_want_nonmember_container_access
73#include <bits/version.h>
74
75#if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
76#include <bits/memory_resource.h>
77namespace std _GLIBCXX_VISIBILITY(default)
78{
79_GLIBCXX_BEGIN_NAMESPACE_VERSION
80 namespace pmr
81 {
82 template<typename _BidirectionalIterator>
83 using match_results
84 = std::match_results<_BidirectionalIterator, polymorphic_allocator<
85 sub_match<_BidirectionalIterator>>>;
86 using cmatch = match_results<const char*>;
87 // Use __normal_iterator directly, because pmr::string::const_iterator
88 // would require pmr::polymorphic_allocator to be complete.
89 using smatch
90 = match_results<__gnu_cxx::__normal_iterator<const char*, string>>;
91#ifdef _GLIBCXX_USE_WCHAR_T
92 using wcmatch = match_results<const wchar_t*>;
93 using wsmatch
94 = match_results<__gnu_cxx::__normal_iterator<const wchar_t*, wstring>>;
95#endif
96 } // namespace pmr
97_GLIBCXX_END_NAMESPACE_VERSION
98} // namespace std
99#endif // C++17
100#endif // C++11
101
102#endif // _GLIBCXX_REGEX
bitset
locale
stack
stdexcept
string
c++0x_warning.h
stl_algo.h
stl_algobase.h
stl_iterator_base_types.h
stl_pair.h
version.h
memory_resource.h
regex.h
regex_constants.h
Constant definitions for the std regex library.
regex_error.h
Error and exception objects for the std regex library.
regex_scanner.h
regex_automaton.h
regex_compiler.h
regex_executor.h
requires_hosted.h
std_function.h
stl_bvector.h
stl_map.h
stl_tree.h
stl_vector.h
vector.tcc
aligned_buffer.h
std
ISO C++ entities toplevel namespace is std.
std::pmr::polymorphic_allocator
Class template polymorphic_allocator.
Definition memory_resource.h:124
shared_ptr.h
numeric_traits.h
vector