mirror of
https://github.com/boostorg/regex.git
synced 2025-06-26 20:31:35 +02:00
Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
f851a08050 | |||
f0ae2d8f57 | |||
34b1c2f615 | |||
187be72eb8 | |||
0b64ecef6c | |||
9a408042d7 | |||
35937503ca | |||
31f98f2cf6 | |||
093e135925 | |||
4f4c729547 | |||
a40c96df3a | |||
85ffdd9636 | |||
7af2aadcb8 | |||
4cbcd3078e | |||
a851f2141f | |||
57aca85a8e | |||
177ee2cc0f | |||
63575ddad8 | |||
e1c8a4b6a4 | |||
9b946cfcb7 | |||
86f82635d4 | |||
0c8158f6ce | |||
a3f97b5bec | |||
13a13e58c9 | |||
714eaf8ae9 | |||
78e73e29ec | |||
39f28ac456 | |||
e9645776f9 | |||
ea23777b48 | |||
c21b52d87c | |||
18e7b8c463 | |||
866d546fd0 | |||
309eee3459 | |||
c653a0bf05 | |||
a9fc8fb5de | |||
b3f73b4792 | |||
5bc2a4a301 | |||
8191d58266 | |||
f0b577a82c | |||
ed556985d7 | |||
bf7d64a7ef | |||
6f02c1a388 | |||
dec7b5028d | |||
dd20ac2669 | |||
d84bab7c4d | |||
9034bd9c02 |
55
.github/workflows/ci.yml
vendored
55
.github/workflows/ci.yml
vendored
@ -10,9 +10,14 @@ on:
|
||||
- master
|
||||
- develop
|
||||
- feature/**
|
||||
- cve-*
|
||||
pull_request:
|
||||
release:
|
||||
types: [published, created, edited]
|
||||
|
||||
env:
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
|
||||
jobs:
|
||||
ubuntu-jammy:
|
||||
runs-on: ubuntu-22.04
|
||||
@ -60,7 +65,7 @@ jobs:
|
||||
run: ../../../b2 print_config_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 toolset=$TOOLSET
|
||||
run: ../../../b2 toolset=$TOOLSET variant=debug,release ${{ startsWith(matrix.compiler, 'g++-13') && 'address-sanitizer=norecover undefined-sanitizer=norecover' || '' }}
|
||||
working-directory: ../boost-root/libs/regex/test
|
||||
ubuntu-jammy-standalone:
|
||||
runs-on: ubuntu-22.04
|
||||
@ -170,6 +175,54 @@ jobs:
|
||||
- name: Test
|
||||
run: CXX=clang++-18 LIBRARIES="-licuuc -licudata -licui18n" ./test_clang.sh
|
||||
working-directory: ../boost-root/libs/regex/test/module
|
||||
ubuntu-noble-clang:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler: [ clang++-16, clang++-17, clang++-18 ]
|
||||
standard: [ c++11, c++14, c++17, c++20 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- uses: mstachniuk/ci-skip@v1
|
||||
with:
|
||||
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
|
||||
commit-filter-separator: ';'
|
||||
fail-fast: true
|
||||
- name: Set TOOLSET
|
||||
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
|
||||
- name: Add repository
|
||||
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
|
||||
- name: Install packages
|
||||
run: sudo apt install clang-16 clang-17 clang-18
|
||||
- name: Checkout main boost
|
||||
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
|
||||
- name: Update tools/boostdep
|
||||
run: git submodule update --init tools/boostdep
|
||||
working-directory: ../boost-root
|
||||
- name: Copy files
|
||||
run: cp -r $GITHUB_WORKSPACE/* libs/regex
|
||||
working-directory: ../boost-root
|
||||
- name: Install deps
|
||||
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
|
||||
working-directory: ../boost-root
|
||||
- name: Bootstrap
|
||||
run: ./bootstrap.sh
|
||||
working-directory: ../boost-root
|
||||
- name: Generate headers
|
||||
run: ./b2 headers
|
||||
working-directory: ../boost-root
|
||||
- name: Generate user config
|
||||
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
|
||||
working-directory: ../boost-root
|
||||
- name: Config info
|
||||
run: ../../../b2 print_config_info toolset=$TOOLSET
|
||||
working-directory: ../boost-root/libs/config/test
|
||||
- name: Test
|
||||
run: ../../../b2 toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER variant=debug,release ${{ startsWith(matrix.compiler, 'clang++-18') && 'address-sanitizer=norecover undefined-sanitizer=norecover' || '' }}
|
||||
working-directory: ../boost-root/libs/regex/test
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
|
@ -898,6 +898,11 @@ escape_type_class_jump:
|
||||
}
|
||||
const charT* pc = m_position;
|
||||
std::intmax_t i = this->m_traits.toi(pc, m_end, 10);
|
||||
if(i < 0 && !syn_end)
|
||||
{
|
||||
fail(regex_constants::error_backref, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
if((i < 0) && syn_end)
|
||||
{
|
||||
// Check for a named capture, get the leftmost one if there is more than one:
|
||||
@ -997,7 +1002,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
if((m_position != m_end)
|
||||
&& (0 == (this->flags() & regbase::main_option_type))
|
||||
&& (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus))
|
||||
{
|
||||
{
|
||||
possessive = true;
|
||||
++m_position;
|
||||
}
|
||||
@ -1114,6 +1119,13 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
else
|
||||
contin = false;
|
||||
break;
|
||||
case regex_constants::syntax_hash:
|
||||
if (this->flags() & regex_constants::mod_x) {
|
||||
while((m_position != m_end) && !is_separator(*m_position++)){}
|
||||
contin = true;
|
||||
break;
|
||||
}
|
||||
BOOST_REGEX_FALLTHROUGH;
|
||||
default:
|
||||
contin = false;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ BOOST_REGEX_MODULE_EXPORT inline match_flags operator|(match_flags m1, match_fla
|
||||
BOOST_REGEX_MODULE_EXPORT inline match_flags operator^(match_flags m1, match_flags m2)
|
||||
{ return static_cast<match_flags>(static_cast<std::int32_t>(m1) ^ static_cast<std::int32_t>(m2)); }
|
||||
BOOST_REGEX_MODULE_EXPORT inline match_flags operator~(match_flags m1)
|
||||
{ return static_cast<match_flags>(~static_cast<std::int32_t>(m1)); }
|
||||
{ return static_cast<match_flags>(~static_cast<std::int32_t>(m1) & static_cast<std::int32_t>(match_not_any)); }
|
||||
BOOST_REGEX_MODULE_EXPORT inline match_flags& operator&=(match_flags& m1, match_flags m2)
|
||||
{ m1 = m1&m2; return m1; }
|
||||
BOOST_REGEX_MODULE_EXPORT inline match_flags& operator|=(match_flags& m1, match_flags m2)
|
||||
|
@ -227,6 +227,10 @@ public:
|
||||
{
|
||||
if(m_is_singular && m_subs.empty())
|
||||
raise_logic_error();
|
||||
|
||||
if (sub >= INT_MAX - 2 )
|
||||
return m_null;
|
||||
|
||||
sub += 2;
|
||||
if(sub < (int)m_subs.size() && (sub >= 0))
|
||||
{
|
||||
|
@ -237,8 +237,8 @@ void perl_matcher<BidiIterator, Allocator, traits>::extend_stack()
|
||||
saved_state* backup_state;
|
||||
stack_base = static_cast<saved_state*>(get_mem_block());
|
||||
backup_state = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(stack_base)+BOOST_REGEX_BLOCKSIZE);
|
||||
saved_extra_block* block = static_cast<saved_extra_block*>(backup_state);
|
||||
--block;
|
||||
saved_extra_block* block = reinterpret_cast<saved_extra_block*>(
|
||||
reinterpret_cast<std::uintptr_t>(backup_state) - sizeof(saved_extra_block));
|
||||
(void) new (block) saved_extra_block(m_stack_base, m_backup_state);
|
||||
m_stack_base = stack_base;
|
||||
m_backup_state = block;
|
||||
|
@ -19,6 +19,8 @@
|
||||
#ifndef BOOST_REGEX_V5_REGBASE_HPP
|
||||
#define BOOST_REGEX_V5_REGBASE_HPP
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
|
||||
namespace boost{
|
||||
//
|
||||
// class regbase
|
||||
|
@ -19,6 +19,8 @@
|
||||
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
#define BOOST_REGEX_SYNTAX_TYPE_HPP
|
||||
|
||||
#include <boost/regex/config.hpp>
|
||||
|
||||
namespace boost{
|
||||
namespace regex_constants{
|
||||
|
||||
|
@ -137,5 +137,8 @@ compile test_windows_defs_4.cpp ;
|
||||
run issue153.cpp : : : "<toolset>msvc:<linkflags>-STACK:2097152" ;
|
||||
run issue227.cpp ;
|
||||
run issue232.cpp ;
|
||||
run issue244.cpp ;
|
||||
run issue245.cpp ;
|
||||
run lookbehind_recursion_stress_test.cpp ;
|
||||
run regex_replace_overflow.cpp ;
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
Z(((((((a+)+)+)+)+)+)+)+|Y(((((((a+)+)+)+)+)+)+)+|X(((((((a+)+)+)+)+)+)+)+|W(((((((a+)+)+)+)+)+)+)+|V(((((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+;+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV(((((((a+)+)+)+)+)+)+)+|(a+)+b)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
Z(((((((a+)+)+)+)+<2B><><EFBFBD><EFBFBD>)+|Y(((((((a+)+)+)+)+)++)+)|X(((((((a+)+)+)+)+)+)+)+|W((<28><>(((a+)+)+)+)+)+)+)+;|V((()++)+)+|CW(((((((a+)+)+)+((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+)+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV,((((((a+)+)+)+)+)+)+)+|(a+)+bc
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
8^\l*(?:((.<2E>*?)\W*(?1)\<5C>*\2[abc]| |((.)\)W*(?1)\W*\4|\ZZZZZZZZZZZZZZZZZZZZZZ<1B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\pd\)W*(?1)\W*\4|\ZZZZZZZZZZZZZZZZZZZZZZ<1B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><1B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\pd<1B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><1B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\pdquick brown )ox
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,73 +0,0 @@
|
||||
'<27> (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* # optional leading comment
|
||||
(?: (?:
|
||||
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
|
||||
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
||||
|
|
||||
" (?: # opening quote...
|
||||
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
|
||||
| # or
|
||||
\\ [^\x80-\xff] # Escaped something (something != CR)
|
||||
)* " # closing quote
|
||||
) # initial word
|
||||
(?: (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* \. (?: [\040\t] | \(\x80-\xff]+ # some number of atom characters...
|
||||
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
||||
|
|
||||
" (?: # opening quote...
|
||||
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
|
||||
| # or
|
||||
\\ [^\x80-\xff] # Escaped something (something != CR)
|
||||
)* " # closing quote
|
||||
) # initial word
|
||||
(?: (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* \. (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* (?:
|
||||
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
|
||||
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
||||
|
|
||||
" (?: # opening quote...
|
||||
[^\\\x80-\xff\n\015"] # Anything except backslash and quote
|
||||
| # or
|
||||
\\ [^\x80-\xff] # Escaped something (something != CR)
|
||||
)* " # closing quote
|
||||
) )* # further okay, if led by a period
|
||||
(?: (\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* @ (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* (?:
|
||||
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
|
||||
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
||||
| \[ # [
|
||||
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
|
||||
\] # ]
|
||||
) # initial subdomain
|
||||
(?: #
|
||||
(?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* \. # if led by a period...
|
||||
(?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* (?:
|
||||
[^(\04<30>)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
|
||||
(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
|
||||
| \[ # [
|
||||
(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
|
||||
\] # ]
|
||||
) # ...further okay
|
||||
)*
|
||||
# address spec
|
||||
(?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] ^ | \\[\x80-\xff] )* \) )*
|
||||
\) )* > # trailing >
|
||||
# name and address
|
||||
) (?: [\040\t] | \(
|
||||
(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
|
||||
\) )* # optional trailing comment
|
||||
|
||||
<user@dom.ain>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user