8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); 23 |
24 |28 | This function returns the size, in bytes, of the match data block that is its 29 | argument. 30 |
31 |32 | There is a complete description of the PCRE2 native API in the 33 | pcre2api 34 | page and a description of the POSIX API in the 35 | pcre2posix 36 | page. 37 |
38 | Return to the PCRE2 index page. 39 |
40 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_set_newline.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_SET_NEWLINE 3 "19 July 2017" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); 23 |
24 |28 | This function returns the number of pairs of offsets in the ovector that forms 29 | part of the given match data block. 30 |
31 |32 | There is a complete description of the PCRE2 native API in the 33 | pcre2api 34 | page and a description of the POSIX API in the 35 | pcre2posix 36 | page. 37 |
38 | Return to the PCRE2 index page. 39 |
40 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_match_limit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_match_limit(pcre2_match_context *mcontext, 23 | uint32_t value); 24 |
25 |29 | This function sets the match limit field in a match context. The result is 30 | always zero. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE.NET.Tests/PcreNet/PcreBuildInfoTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using NUnit.Framework; 5 | 6 | namespace PCRE.Tests.PcreNet; 7 | 8 | [TestFixture] 9 | public class PcreBuildInfoTests 10 | { 11 | [Test] 12 | public void should_report_version() 13 | { 14 | var value = PcreBuildInfo.Version; 15 | Console.WriteLine(value); 16 | Assert.That(value, Is.Not.Null.Or.Empty); 17 | } 18 | 19 | [Test] 20 | public void should_report_jit_target() 21 | { 22 | Assert.That(PcreBuildInfo.Jit, Is.True); 23 | 24 | var value = PcreBuildInfo.JitTarget; 25 | Console.WriteLine(value); 26 | Assert.That(value, Is.Not.Null.Or.Empty); 27 | } 28 | 29 | [Test] 30 | public void should_report_all_config_info() 31 | { 32 | var properties = typeof(PcreBuildInfo) 33 | .GetProperties(BindingFlags.Public | BindingFlags.Static) 34 | .Where(prop => prop.CanRead); 35 | 36 | foreach (var propertyInfo in properties) 37 | { 38 | var value = propertyInfo.GetValue(null); 39 | Console.WriteLine("{0} = {1}", propertyInfo.Name, value); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_heap_limit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_heap_limit(pcre2_match_context *mcontext, 23 | uint32_t value); 24 |
25 |29 | This function sets the backtracking heap limit field in a match context. The 30 | result is always zero. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_offset_limit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_offset_limit(pcre2_match_context *mcontext, 23 | PCRE2_SIZE value); 24 |
25 |29 | This function sets the offset limit field in a match context. The result is 30 | always zero. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_depth_limit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_depth_limit(pcre2_match_context *mcontext, 23 | uint32_t value); 24 |
25 |29 | This function sets the backtracking depth limit field in a match context. The 30 | result is always zero. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_maketables.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_MAKETABLES 3 "26 February 2025" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_recursion_limit(pcre2_match_context *mcontext, 23 | uint32_t value); 24 |
25 |29 | This function is obsolete and should not be used in new code. Use 30 | pcre2_set_depth_limit() instead. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_serialize_get_number_of_codes.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_SERIALIZE_GET_NUMBER_OF_CODES 3 "13 August 2018" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | PCRE2_SIZE pcre2_get_match_data_heapframes_size( 23 | pcre2_match_data *match_data); 24 |
25 |29 | This function returns the size, in bytes, of the heapframes data block that is 30 | owned by its argument. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE.NET.Tests/Support/TestSupport.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace PCRE.Tests.Support; 5 | 6 | public static class TestSupport 7 | { 8 | public static readonly Encoding Latin1Encoding = Encoding.GetEncoding("ISO-8859-1"); 9 | 10 | public static byte[] ToLatin1Bytes(this string str) 11 | => Latin1Encoding.GetBytes(str); 12 | 13 | public static PcreRegex8Bit CreatePcreRegex8Bit(string pattern) 14 | => new(pattern.ToLatin1Bytes(), Latin1Encoding); 15 | 16 | public static PcreRegex8Bit CreatePcreRegex8Bit(string pattern, PcreOptions options) 17 | => new(pattern.ToLatin1Bytes(), Latin1Encoding, options); 18 | 19 | public static PcreRegex8Bit CreatePcreRegex8Bit(string pattern, PcreRegexSettings settings) 20 | => new(pattern.ToLatin1Bytes(), Latin1Encoding, settings); 21 | 22 | public static PcreRegex8Bit CreatePcreRegex8Bit(ReadOnlySpan8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, 23 | uint32_t value); 24 |
25 |29 | This function sets, in a compile context, the maximum depth of nested 30 | parentheses in a pattern. The result is always zero. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_substring_number_from_name.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_SUBSTRING_NUMBER_FROM_NAME 3 "03 November 2014" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); 23 |
24 |28 | This function returns a pointer to the vector of offsets that forms part of the 29 | given match data block. The number of pairs can be found by calling 30 | pcre2_get_ovector_count(). 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE.NET.InternalAnalyzers/Support/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.CodeAnalysis; 4 | using Microsoft.CodeAnalysis.CSharp; 5 | using Microsoft.CodeAnalysis.Diagnostics; 6 | 7 | namespace PCRE.NET.InternalAnalyzers.Support; 8 | 9 | internal static class Extensions 10 | { 11 | public static IncrementalValuesProvider8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_convert_context *pcre2_convert_context_copy( 23 | pcre2_convert_context *cvcontext); 24 |
25 |29 | This function is part of an experimental set of pattern conversion functions. 30 | It makes a new copy of a convert context, using the memory allocation function 31 | that was used for the original context. The result is NULL if the memory cannot 32 | be obtained. 33 |
34 |35 | The pattern conversion functions are described in the 36 | pcre2convert 37 | documentation. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/cmake/PCRE2WarningAsError.cmake: -------------------------------------------------------------------------------- 1 | # This file can be removed once the minimum CMake version is increased to 3.24 2 | # or higher. Calls to pcre2_warning_as_error can be changed to the built in 3 | # CMAKE_C_COMPILE_OPTIONS_WARNING_AS_ERROR. 4 | 5 | function(pcre2_warning_as_error out_var) 6 | set(${out_var} "" PARENT_SCOPE) 7 | 8 | if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) 9 | # Since CMake 3.24, we should use the CMAKE_C_COMPILE_OPTIONS_WARNING_AS_ERROR 10 | # variable for greatest compiler compatibility. 11 | if(DEFINED CMAKE_C_COMPILE_OPTIONS_WARNING_AS_ERROR) 12 | set(${out_var} "${CMAKE_C_COMPILE_OPTIONS_WARNING_AS_ERROR}" PARENT_SCOPE) 13 | endif() 14 | else() 15 | # The fallback probes for support, trying a few common flags. 16 | 17 | if(NOT MSVC) 18 | include(CheckCCompilerFlag) 19 | include(CMakePushCheckState) 20 | 21 | cmake_push_check_state(RESET) 22 | check_c_compiler_flag("-Werror" HAVE_WERROR) 23 | if(HAVE_WERROR) 24 | set(${out_var} "-Werror" PARENT_SCOPE) 25 | else() 26 | check_c_compiler_flag("-errwarn=%all" HAVE_ERRWARN_ALL) 27 | if(HAVE_ERRWARN_ALL) 28 | set(${out_var} "-errwarn=%all" PARENT_SCOPE) 29 | endif() 30 | endif() 31 | 32 | cmake_pop_check_state() 33 | endif() 34 | endif() 35 | endfunction() 36 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_match_context_copy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_match_context *pcre2_match_context_copy( 23 | pcre2_match_context *mcontext); 24 |
25 |29 | This function makes a new copy of a match context, using the memory 30 | allocation function that was used for the original context. The result is NULL 31 | if the memory cannot be obtained. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_general_context_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_general_context_free(pcre2_general_context *gcontext); 23 |
24 |28 | This function frees the memory occupied by a general context, using the memory 29 | freeing function within the context, if set. If the argument is NULL, the 30 | function returns immediately without doing anything. 31 |
32 |33 | There is a complete description of the PCRE2 native API in the 34 | pcre2api 35 | page and a description of the POSIX API in the 36 | pcre2posix 37 | page. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE.NET/PcreSubstituteCase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using PCRE.Internal; 3 | 4 | namespace PCRE; 5 | 6 | ///8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_compile_context *pcre2_compile_context_copy( 23 | pcre2_compile_context *ccontext); 24 |
25 |29 | This function makes a new copy of a compile context, using the memory 30 | allocation function that was used for the original context. The result is NULL 31 | if the memory cannot be obtained. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE.NET.Tests/ManualTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Reflection; 5 | using System.Text.RegularExpressions; 6 | using NUnit.Framework; 7 | using PCRE.Internal; 8 | 9 | namespace PCRE.Tests; 10 | 11 | [TestFixture, Explicit] 12 | public class ManualTests 13 | { 14 | [Test] 15 | public void generate_error_codes() 16 | { 17 | const string errorPrefix = "ERROR_"; 18 | 19 | var errorCodes = typeof(PcreConstants).GetFields(BindingFlags.Public | BindingFlags.Static) 20 | .Where(i => i.IsLiteral && i.Name.StartsWith(errorPrefix)) 21 | .Select(i => (i.Name, (int)i.GetRawConstantValue()!)); 22 | 23 | foreach (var (name, value) in errorCodes) 24 | { 25 | var memberName = Regex.Replace(name.Substring(errorPrefix.Length).ToLowerInvariant(), @"(?:^|_)(?8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_serialize_free(uint8_t *bytes); 23 |
24 |28 | This function frees the memory that was obtained by 29 | pcre2_serialize_encode() to hold a serialized byte stream. The argument 30 | must point to such a byte stream or be NULL, in which case the function returns 31 | without doing anything. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the serialization functions in the 37 | pcre2serialize 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_substring_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_substring_free(PCRE2_UCHAR *buffer); 23 |
24 |28 | This is a convenience function for freeing the memory obtained by a previous 29 | call to pcre2_substring_get_byname() or 30 | pcre2_substring_get_bynumber(). Its only argument is a pointer to the 31 | string. If the argument is NULL, the function does nothing. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_bsr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_bsr(pcre2_compile_context *ccontext, 23 | uint32_t value); 24 |
25 |29 | This function sets the convention for processing \R within a compile context. 30 | The second argument must be one of PCRE2_BSR_ANYCRLF or PCRE2_BSR_UNICODE. The 31 | result is zero for success or PCRE2_ERROR_BADDATA if the second argument is 32 | invalid. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE.NET.Native/pcrenet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_convert_context_free(pcre2_convert_context *cvcontext); 23 |
24 |28 | This function is part of an experimental set of pattern conversion functions. 29 | It frees the memory occupied by a convert context, using the memory 30 | freeing function from the general context with which it was created, or 31 | free() if that was not set. If the argument is NULL, the function returns 32 | immediately without doing anything. 33 |
34 |35 | The pattern conversion functions are described in the 36 | pcre2convert 37 | documentation. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_substring_list_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_substring_list_free(PCRE2_UCHAR **list); 23 |
24 |28 | This is a convenience function for freeing the store obtained by a previous 29 | call to pcre2substring_list_get(). Its only argument is a pointer to 30 | the list of string pointers. If the argument is NULL, the function returns 31 | immediately, without doing anything. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_match_context_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_match_context_free(pcre2_match_context *mcontext); 23 |
24 |28 | This function frees the memory occupied by a match context, using the memory 29 | freeing function from the general context with which it was created, or 30 | free() if that was not set. If the argument is NULL, the function returns 31 | immediately without doing anything. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_get_error_message.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_GET_ERROR_MESSAGE 3 "24 March 2017" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_general_context *pcre2_general_context_copy( 23 | pcre2_general_context *gcontext); 24 |
25 |29 | This function makes a new copy of a general context, using the memory 30 | allocation functions in the context, if set, to get the necessary memory. 31 | Otherwise malloc() is used. The result is NULL if the memory cannot be 32 | obtained. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_jit_stack_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); 23 |
24 |28 | This function is used to free a JIT stack that was created by 29 | pcre2_jit_stack_create() when it is no longer needed. If the argument is 30 | NULL, the function returns immediately without doing anything. For more 31 | details, see the 32 | pcre2jit 33 | page. 34 |
35 |36 | There is a complete description of the PCRE2 native API in the 37 | pcre2api 38 | page and a description of the POSIX API in the 39 | pcre2posix 40 | page. 41 |
42 | Return to the PCRE2 index page. 43 |
44 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_match_data_create.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_MATCH_DATA_CREATE 3 "28 August 2021" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_compile_context_free(pcre2_compile_context *ccontext); 23 |
24 |28 | This function frees the memory occupied by a compile context, using the memory 29 | freeing function from the general context with which it was created, or 30 | free() if that was not set. If the argument is NULL, the function returns 31 | immediately without doing anything. 32 |
33 |34 | There is a complete description of the PCRE2 native API in the 35 | pcre2api 36 | page and a description of the POSIX API in the 37 | pcre2posix 38 | page. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_maketables_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_maketables_free(pcre2_general_context *gcontext, 23 | const uint8_t *tables); 24 |
25 |29 | This function discards a set of character tables that were created by a call 30 | to 31 | pcre2_maketables(). 32 |
33 |34 | The gcontext parameter should match what was used in that call to 35 | account for any custom allocators that might be in use; if it is NULL 36 | the system free() is used. 37 |
38 |39 | There is a complete description of the PCRE2 native API in the 40 | pcre2api 41 | page. 42 |
43 | Return to the PCRE2 index page. 44 |
45 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_code_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_code_free(pcre2_code *code); 23 |
24 |28 | If code is NULL, this function does nothing. Otherwise, code must 29 | point to a compiled pattern. This function frees its memory, including any 30 | memory used by the JIT compiler. If the compiled pattern was created by a call 31 | to pcre2_code_copy_with_tables(), the memory for the character tables is 32 | also freed. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_converted_pattern_free.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern); 23 |
24 |28 | This function is part of an experimental set of pattern conversion functions. 29 | It frees the memory occupied by a converted pattern that was obtained by 30 | calling pcre2_pattern_convert() with arguments that caused it to place 31 | the converted pattern into newly obtained heap memory. If the argument is NULL, 32 | the function returns immediately without doing anything. 33 |
34 |35 | The pattern conversion functions are described in the 36 | pcre2convert 37 | documentation. 38 |
39 | Return to the PCRE2 index page. 40 |
41 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_convert_context_create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_convert_context *pcre2_convert_context_create( 23 | pcre2_general_context *gcontext); 24 |
25 |29 | This function is part of an experimental set of pattern conversion functions. 30 | It creates and initializes a new convert context. If its argument is 31 | NULL, malloc() is used to get the necessary memory; otherwise the memory 32 | allocation function within the general context is used. The result is NULL if 33 | the memory could not be obtained. 34 |
35 |36 | The pattern conversion functions are described in the 37 | pcre2convert 38 | documentation. 39 |
40 | Return to the PCRE2 index page. 41 |
42 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_recursion_memory_management.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_recursion_memory_management( 23 | pcre2_match_context *mcontext, 24 | void *(*private_malloc)(size_t, void *), 25 | void (*private_free)(void *, void *), void *memory_data); 26 |
27 |31 | From release 10.30 onwards, this function is obsolete and does nothing. The 32 | result is always zero. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_match_context_create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_match_context *pcre2_match_context_create( 23 | pcre2_general_context *gcontext); 24 |
25 |29 | This function creates and initializes a new match context. If its argument is 30 | NULL, malloc() is used to get the necessary memory; otherwise the memory 31 | allocation function within the general context is used. The result is NULL if 32 | the memory could not be obtained. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_compile_context_create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | pcre2_compile_context *pcre2_compile_context_create( 23 | pcre2_general_context *gcontext); 24 |
25 |29 | This function creates and initializes a new compile context. If its argument is 30 | NULL, malloc() is used to get the necessary memory; otherwise the memory 31 | allocation function within the general context is used. The result is NULL if 32 | the memory could not be obtained. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_callout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_callout(pcre2_match_context *mcontext, 23 | int (*callout_function)(pcre2_callout_block *), 24 | void *callout_data); 25 |
26 |30 | This function sets the callout fields in a match context (the first argument). 31 | The second argument specifies a callout function, and the third argument is an 32 | opaque data item that is passed to it. The result of this function is always 33 | zero. 34 |
35 |36 | There is a complete description of the PCRE2 native API in the 37 | pcre2api 38 | page and a description of the POSIX API in the 39 | pcre2posix 40 | page. 41 |
42 | Return to the PCRE2 index page. 43 |
44 | -------------------------------------------------------------------------------- /src/PCRE.NET.Tests.Integration/IntegrationTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace PCRE.Tests.Integration; 4 | 5 | [TestFixture(Category = "Integration")] 6 | public class IntegrationTests 7 | { 8 | [Test] 9 | [TestCase(PcreOptions.None)] 10 | [TestCase(PcreOptions.Compiled)] 11 | public void should_match_expected_values(PcreOptions options) 12 | { 13 | var re = new PcreRegex("a+(b+)c+", options); 14 | var match = re.Match("xxxaaabbccczzz"); 15 | 16 | Assert.That(match, Is.Not.Null); 17 | Assert.That(match.Success, Is.True); 18 | Assert.That(match.CaptureCount, Is.EqualTo(1)); 19 | Assert.That(match.Value, Is.EqualTo("aaabbccc")); 20 | Assert.That(match.ValueSpan.ToString(), Is.EqualTo("aaabbccc")); 21 | Assert.That(match.Index, Is.EqualTo(3)); 22 | Assert.That(match.EndIndex, Is.EqualTo(11)); 23 | Assert.That(match.Length, Is.EqualTo(8)); 24 | 25 | Assert.That(match[1], Is.Not.Null); 26 | Assert.That(match[1].Success, Is.True); 27 | Assert.That(match[1].Value, Is.EqualTo("bb")); 28 | Assert.That(match[1].ValueSpan.ToString(), Is.EqualTo("bb")); 29 | Assert.That(match[1].Index, Is.EqualTo(6)); 30 | Assert.That(match[1].Length, Is.EqualTo(2)); 31 | 32 | Assert.That(match.Groups[1], Is.SameAs(match[1])); 33 | 34 | #if !PCRENET_INTEGRATION_TEST 35 | Assert.Fail("Not in integration tests mode"); 36 | #endif 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/PCRE/doc/pcre2_jit_stack_create.3: -------------------------------------------------------------------------------- 1 | .TH PCRE2_JIT_STACK_CREATE 3 "23 January 2023" "PCRE2 10.47" 2 | .SH NAME 3 | PCRE2 - Perl-compatible regular expressions (revised API) 4 | .SH SYNOPSIS 5 | .rs 6 | .sp 7 | .B #include8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_max_varlookbehind(pcre2_compile_context *ccontext, 23 | uint32_t value); 24 |
25 |29 | This sets a maximum length for the number of characters matched by a 30 | variable-length lookbehind assertion. The default is set when PCRE2 is built, 31 | with the ultimate default being 255, the same as Perl. Lookbehind assertions 32 | without a bounding length are not supported. The result is always zero. 33 |
34 |35 | There is a complete description of the PCRE2 native API in the 36 | pcre2api 37 | page and a description of the POSIX API in the 38 | pcre2posix 39 | page. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE.NET/PcreRegex8Bit.Match.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using PCRE.Internal; 4 | 5 | namespace PCRE; 6 | 7 | [SuppressMessage("ReSharper", "UnusedMember.Global")] 8 | [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] 9 | [SuppressMessage("ReSharper", "IntroduceOptionalParameters.Global")] 10 | public partial class PcreRegex8Bit 11 | { 12 | ///8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); 23 |
24 |28 | This function frees unused JIT executable memory. The argument is a general 29 | context, for custom memory management, or NULL for standard memory management. 30 | JIT memory allocation retains some memory in order to improve future JIT 31 | compilation speed. In low memory conditions, 32 | pcre2_jit_free_unused_memory() can be used to cause this memory to be 33 | freed. 34 |
35 |36 | There is a complete description of the PCRE2 native API in the 37 | pcre2api 38 | page and a description of the POSIX API in the 39 | pcre2posix 40 | page. 41 |
42 | Return to the PCRE2 index page. 43 |
44 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_glob_separator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_glob_separator(pcre2_convert_context *cvcontext, 23 | uint32_t separator_char); 24 |
25 |29 | This function is part of an experimental set of pattern conversion functions. 30 | It sets the component separator character that is used when converting globs. 31 | The second argument must be one of the characters forward slash, backslash, or 32 | dot. The default is backslash when running under Windows, otherwise forward 33 | slash. The result of the function is zero for success or PCRE2_ERROR_BADDATA if 34 | the second argument is invalid. 35 |
36 |37 | The pattern conversion functions are described in the 38 | pcre2convert 39 | documentation. 40 |
41 | Return to the PCRE2 index page. 42 |
43 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_max_pattern_length.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, 23 | PCRE2_SIZE value); 24 |
25 |29 | This function sets, in a compile context, the maximum text length (in code 30 | units) of the pattern that can be compiled. The result is always zero. If a 31 | longer pattern is passed to pcre2_compile() there is an immediate error 32 | return. The default is effectively unlimited, being the largest value a 33 | PCRE2_SIZE variable can hold. 34 |
35 |36 | There is a complete description of the PCRE2 native API in the 37 | pcre2api 38 | page and a description of the POSIX API in the 39 | pcre2posix 40 | page. 41 |
42 | Return to the PCRE2 index page. 43 |
44 | -------------------------------------------------------------------------------- /src/PCRE/deps/sljit/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Stack-less Just-In-Time compiler 3 | * 4 | * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, are 7 | * permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, this list of 10 | * conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list 13 | * of conditions and the following disclaimer in the documentation and/or other materials 14 | * provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 24 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | -------------------------------------------------------------------------------- /src/PCRE/doc/html/pcre2_set_substitute_callout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |8 | Return to the PCRE2 index page. 9 |
10 |
11 | This page is part of the PCRE2 HTML documentation. It was generated
12 | automatically from the original man page. If there is any nonsense in it,
13 | please consult the man page, in case the conversion went wrong.
14 |
15 |
19 | #include <pcre2.h> 20 |
21 |22 | int pcre2_set_substitute_callout(pcre2_match_context *mcontext, 23 | int (*callout_function)(pcre2_substitute_callout_block *, void *), 24 | void *callout_data); 25 |
26 |30 | This function sets the substitute callout fields in a match context (the first 31 | argument). The second argument specifies a callout function, and the third 32 | argument is an opaque data item that is passed to it. The result of this 33 | function is always zero. 34 |
35 |36 | There is a complete description of the PCRE2 native API in the 37 | pcre2api 38 | page and a description of the POSIX API in the 39 | pcre2posix 40 | page. 41 |
42 | Return to the PCRE2 index page. 43 |
44 | --------------------------------------------------------------------------------