regex 3.0 KB

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