Skip to main content

Questions tagged [pcre]

Perl Compatible Regular Expressions(PCRE) was initially developed as a regex engine for PERL, but grew into a library that many other languages (like PHP and Apache) use for their regex. Use with the [regex] tag and any appropriate language tags.

0 votes
1 answer
43 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....
Random Guy's user avatar
0 votes
1 answer
53 views

Why regex pattern is validated in some languages like Java, JavaScript but failed in Python and Regex101?

I have a regex pattern ^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}. It validated in Java and the Browser console but failed in Python. Various online regex testers produced different results. Regex101 displayed ...
Prabhjot Kaur's user avatar
2 votes
3 answers
100 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: ...
Vivek's user avatar
  • 493
-2 votes
1 answer
90 views

Regex to match final word of first line of two-line subs

I'm trying to fine-tune a regex to quickly check if the auto-break feature of Subtitle Edit has produced any funny-looking breaks syntactic/semantic-segmentation-wise. I have put together an extensive ...
Sarah's user avatar
  • 23
1 vote
1 answer
57 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 ...
Del tree's user avatar
0 votes
1 answer
75 views

Is it possible to split a hex string like this using just regex?

Given the following input string (with no whitespaces in it): 000102030405060708090A0B0C0D0E0F10111213... Is it possible to write a substitution regex that would produce the following output? \t0x00, ...
Igor Levicki's user avatar
  • 1,534
0 votes
1 answer
63 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":...
Michael's user avatar
  • 161
1 vote
1 answer
61 views

Regext to find and remove lyrics

I have a workflow that separates the subtitles from a video and then I strip the hearing impaired and other extraneous material from the file. I just want the speaking parts. The lyrics to songs are ...
ArchonOSX's user avatar
  • 121
1 vote
1 answer
51 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/...
akhildevelops's user avatar
5 votes
6 answers
258 views

Regex case-insensitive search, but have output match the case in the regex

Recently I rewrote my program to find English words that are made of chemical symbol abbreviations, for example "HErSHeY". I came up with this dynamic regex: grep -Pi "^($(paste -s -d'|'...
qwr's user avatar
  • 10.4k
0 votes
2 answers
66 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: ...
developer981's user avatar
-4 votes
2 answers
113 views

Regular expression

I would like to have a regular expression to get the number between the '_' and the '/' only and I want to match numbers 1 to 9999 and exclude numbers that are only 0’s catalogue/tipping-the-...
spyhabs's user avatar
0 votes
2 answers
91 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)|\...
draklor40's user avatar
  • 463
2 votes
1 answer
46 views

Why fountain character matches anchor character in regular expression inside range?

In PCRE2 I got a problem with regular expression /[⚓️]/. It has match for string "⛲️". Demo Unexpected behaviour persists only inside range. Can somebody explain why is this happening? By ...
devope's user avatar
  • 237
2 votes
5 answers
76 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 ...
mdromed's user avatar
  • 69

15 30 50 per page
1
2 3 4 5
163