2,437 questions
7
votes
1
answer
178
views
PCRE regular expressions backtracking control
Studying PCRE syntax documentation, I came to the "Backtracking Control" section:
The following act immediately they are reached:
(*ACCEPT) force successful match
(*FAIL) ...
-1
votes
1
answer
122
views
IIS/ASP.NET/Umbraco exception on on w3wp.exe and pcre.dll
I have a Windows Server 2025 VPS managed using Plesk for Windows. On it, I host multiple Umbraco websites. Since recently, an issue occurs where some sites' application pools appear to crash, taking ...
3
votes
3
answers
125
views
regex to match all unescaped '$' in a regex string
I want to build a regex that will match all unescaped $ in strings that represents a regex.
In this case, a character is unescaped if it contains an equal number of backslashes behind it (each pair of ...
1
vote
1
answer
111
views
PCRE regex in R matching `\` and `[` unexpectedly
I am trying to use regex in R to replace forbidden characters. I know
base::make.names can do some of this, but I want to control the replacement
character. I have successfully figured out how to do ...
0
votes
0
answers
59
views
cargo apk build produces android app with unsatisfied symbol pcre2_match_context_free_8
I am developing an android app using Rust and the cargo apk framework.
The application it generates fails to start and the following appears in adb logcat
2025-01-28 10:13:03.560 22985-22985 ...
0
votes
0
answers
87
views
Exclude specific phrase from existing regular expression
This regular expression detects any UK post codes:
([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9][A-Za-z]?))))\...
1
vote
1
answer
92
views
Basic PCRE expression to match word anywhere in a line + another word always at the end of line
Sorry, I had a problem formulating the subject as precisely as I wanted. But I wonder if you could help me with a basic PCRE regular expression that will match/capture like this:
If line contains the ...
0
votes
1
answer
103
views
Missing pcre(Perl Compatible Regular Expressions) object files while building TWRP custom recovery
Actually I am getting these errors while building TWRP custom recovery. I allso tried clean build make clean && make -j$(nproc --all) recoveryimage again and again but it always get stuck here....
2
votes
4
answers
154
views
Regex for matching a certain number of words
I have the following string pattern, from which I'm trying to grab the first 4 to 5 words after the first occurrence of -:
OBJ: redacted - We can't save this record: because the “FBE Record-Trigger: ...
1
vote
1
answer
72
views
Unexpected Regex result that should not be possible
I'm getting unexplained results from a Regex pattern that I am working on, so I have boiled it down to the simplest part of the expression and it seems reasonable to conclude that these results should ...
0
votes
1
answer
83
views
Regex to only return matches when followed by a specific word
I have a fairly long json string that contains a number of results from different automation playbooks. Here is a short snippet:
"name":"update_notable_hash","responses":...
2
votes
1
answer
87
views
Unable to match whole string using PCRE regex in C++
This regular expression '(?:[sdmt]|ll|ve|re)| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+ works as expected to match Ġmeousrtr, this can be seen in the shared link https://regex101.com/r/UR0P6T/...
0
votes
2
answers
106
views
PHP perl regular expression - URL not preceded by equal sign and possible single or double quote
I'm trying to create a perl regular expression that matches a URL that is not preceded by an equal sign and one single or double quote (optional) ignoring whitespace. The code below gives an error: ...
0
votes
2
answers
174
views
Python and PCRE regex that are the same give different outputs for the same input
I am trying to implement the minbpe library in zig, using a wrapper over PCRE library.
The pattern in Python is r"""'(?:[sdmt]|ll|ve|re)| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\...
2
votes
5
answers
91
views
Same regular expression to get 1 or 2 parts of filename
Can anyone help me please?
It is for mod-rewrite in .htaccess
From this url file name:
car-audi-tt-2
I need to get the full string.
But if the string i get is this:
car-audi-tt-2-2019
I need to ...
0
votes
2
answers
90
views
grep - RegEx multiple-criteria select
Given a file containing this string:
IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*OK@IT1*1*CS*VN*ABC@SAC*X*500@REF*ZZ*BAR@IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*BAR@IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*OK@
The goal is to ...
0
votes
3
answers
65
views
Regex to match strings that aren't surrounded by quotes and ignores strings that are
I'm trying to write a Splunk query, and I need to parse out the command line arguments given to a Windows program. Specifically, I'm trying to get the name of the package that is being installed. Here ...
2
votes
4
answers
143
views
Regex: substitute spaces after specific word
I’m trying (and failing) to write a regular expression (PCRE2) which will replace every space with a dash (-) after the first instance of a particular word (namely •VAN•, •VON• or •DE•) which itself ...
0
votes
1
answer
84
views
grep -E (not working) vs grep -Po (working) [duplicate]
I have shell script for ci cd pipeline. I am executing it in intellij ide terminal.
latestVersionAvailable=$(curl -s $artifactoryPath/maven-metadata.xml | grep -Po '(?<=<version>)'$VERSION'.*?...
1
vote
3
answers
83
views
Regex to extract multidimensional keys using bracket notation
I need to retrieve all keys using pure regex.
I need to start with word field and after that need to capture all multiple keys..
field[somevalue][anothervalue]
I'm using this regex:
/^field(?=\[(\w+)](...
-1
votes
1
answer
44
views
POSIX and PCRE compliant regex to extract a word
I want to extract a string whether it is at the beginning of a sentence or the end it has to be the whole word. The expression should work in both PCRE and POSIX.
Example:
input strings=['ALLY [&] ...
1
vote
1
answer
520
views
PCRE not matching U+202F NARROW NO-BREAK SPACE
Context: I’m trying to replace some HTML in an epub using Sigil (epub editor) which can do search/replace using PCRE.
The sequence I’m searching for contains a Narrow No-Break Space (Unicode 0x202f). ...
-2
votes
2
answers
88
views
Regex to capture string except last 2 letters in PCRE
I have a strings test01, abcd02, xyz05 from those strings, I will have last 2 characters are always numbers. From those strings, I want a regex expression to capture test, abcd, xyx. How can I capture ...
1
vote
2
answers
54
views
Replace multiple occurences of character after zero-length assertion
I would like to replace every _ with a - on lines starting with #| label: using PCRE2 regex within my text editor.
Example:
#| label: my_chunk_label
my_function_name <- function(x)
Should become:
...
1
vote
1
answer
59
views
Regex: Match until "," but not if "," is inside brackets
Given the following pattern:
group1: hello, group2: world
group1: hello (hello, world) world, group2: world
group1: hello world
of the style <group_name>: <group_value>[, <group_name&...