Questions tagged [pcre2]

A revised API for the PCRE library, which is a set of functions, written in C, that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences.

The new API is more extensible, and it was simplified by abolishing the separate "study" optimizing function; in PCRE2, patterns are automatically optimized where possible. Since forking from PCRE1, the code has been extensively refactored and new features introduced. See https://www.pcre.org/current/doc/html/pcre2.html for more details.

32 questions
0
votes
0 answers

How to check if a message was repeated in multiple lines in REGEX PCRE2 flavor twitch chatterinoi?

I am trying to make Chatterino (Twitch chat) warn me when the same message is sent over and over again. Chatterino uses REGEX PCRE2 flavor to check if pattern was sent in chat. ^bot\b == warning when someone typed the word "bot" once. I wanted to…
0
votes
0 answers

PCRE2 doesn't match umlauts using "with diaeresis" and "combining diaeresis"

I'm using pcre2 (build with unicode support) in a C++ program. I could successfully match umlauts including mixed upper-/lowercase: auto s1 = "äöü"; auto s2 = "ÄÖÜ"; pcre2_compile(s1, PCRE2_ZERO_TERMINATED, PCRE2_CASELESS | PCRE2_UTF,…
0
votes
1 answer

Regex pattern format for austrian numbers

Here is what i have right now. (\d{4,12}\/*(\+43)* *(\([0-9]+\))*([ ]*(-|–)*[ ]*[0-9]+)) or ([\/ \-\d]*) Allowed: 03852 4637 03852…
Sneertu
  • 21
  • 1
0
votes
0 answers

PCRE2 not found in Mac

I have installed pcre2 version 10.37 by downloading the tar file and doing ./configure make sudo make install When I run pcre2 --version or which pcre2 In the terminal, I get command not found. I am building my project that needs "pcre2" to…
0
votes
1 answer

Repeated patterns in regex

I tried to explain the pattern below. The key-value pair parsing should succeed if the values are separated by a new line or a comma. But separators should not create empty values, like a comma at the beginning, at the end or two consecutive commas,…
Zafer Balkan
  • 176
  • 12
0
votes
0 answers

How to link Reflex with PCRE2?

After installing pcre2, i tried to compile the project with reflex however i get the following error, not sure, I guess I have this set up wrong, however I don't know how to get it done. how I can fix this?
Nguyen Manh
  • 73
  • 1
  • 6
0
votes
1 answer

Replace all matches in pcre2_substitute in C

I replace the first occurrence of the match with pcre2_substitute, #define PCRE2_CODE_UNIT_WIDTH 8 #include #include #include int main(int argc, char **argv) { PCRE2_SPTR pattern = "(\\d+)"; PCRE2_SPTR subject…
Googlebot
  • 15,159
  • 44
  • 133
  • 229
0
votes
1 answer

Regex using recursion with groups

I am not certain if there's any regex magic that can do this: foo(f1, f2()) = bar { b1, b2 {}} //match all of this foo(f3) // dont match this bar{b3} // dont match this what I am trying to do is capture an entire line if it contains this…
Chebz
  • 1,375
  • 3
  • 14
  • 27
0
votes
2 answers

Trying to use GNU find to search recursively for filenames only (not directories) containing a string in any portion of the file name

Trying to find a command that is flexible enough to allow for some variations of the string, but not other variations of it. For instance, I am looking for audio files that have some variation of "rain" in the filename only (rains, raining, rained,…
derrgill
  • 15
  • 5
0
votes
1 answer

Regex PCRE2 verify range of ip address

Currently I'm working on a regular expression wrote in PCRE2 to check a range of IP address ^(10\.).+|(172\.16).+|(192\.168).+ I need the regular expression to check also if in the string I can find any ip between 172.16.X.X - 172.31.X.X The…
0
votes
1 answer

Why does this pattern not produce an error?

Compiled PCRE2 10.39 from source on aarch64 (Apple M1). If I use the pattern Product\d{2,} it compiles and matches correctly, but if I instead use the pattern Product\d{2 it doesn't produce any compile error (pcre2_compile) but rather just doesn't…
jecolon
  • 188
  • 1
  • 7
0
votes
2 answers

How to compile git with PCRE on Mac?

I need the PCRE for this command - git log -i -P --all --grep='^(?=.*fix)(?=.*a)(?=.*bug)' It shows - fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE I tried - brew reinstall pcre git brew reinstall pcre2 git And the…
joydeba
  • 778
  • 1
  • 9
  • 24
0
votes
0 answers

How to modify working regex in PCRE2 but failing in Ruby (invalid conditional pattern)

I've this regex: ^([A-Z]{2,}\!?) ([^(]+)(?\()?((?(BR)[^\)]+))(?(BR)(\)))$ https://regex101.com/r/NiMbut/1 to validate input strings that follow these rules: PREFIX description goes here (optional) PREFIX word required (all upcase,…
0
votes
0 answers

Gcc in windows + pcre2 how can do it?

Hi guys i try to add PCRE2 in GCC in windows, but is very Hell for me , explain my step, in windows i have installed MSYS2_64bit, like in this tutorial https://www.youtube.com/watch?v=jfVqzNU3gPg , after i download a PCRE2 and unzip it in C: and…
-1
votes
1 answer

Match a specific word if it contains an uppercase letter

What's the PCRE2 regular expression syntax to match a specific word if and only if it contains at least one uppercase letter? I can currently match both conditions individually (^foobar$ or [A-Z]+), but don't know how to combine as a compound…
anthumchris
  • 8,245
  • 2
  • 28
  • 53