pcre Questions

10

Solved

I'm trying to search a UTF8-encoded string using preg_match. preg_match('/H/u', "\xC2\xA1Hola!", $a_matches, PREG_OFFSET_CAPTURE); echo $a_matches[0][1]; This should print 1, since &quot...
Phosphorate asked 12/11, 2009 at 20:40

5

Solved

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 -...
Hypsography asked 4/5, 2024 at 0:34

4

Solved

This regular expression matches palindromes: ^((.)(?1)\2|.?)$ Can't wrap my head around how it works. When does the recursion end, and when regex breaks from the recursive subpattern and goes to &q...
Warlike asked 26/7, 2012 at 13:14

4

Solved

I'm getting the following message for some php I have to use but did not write: Deprecated: Function ereg() is deprecated in /opt/lampp/htdocs/webEchange/SiteWeb_V5/inc/html2fpdf.php on line 466 ...
Benham asked 7/2, 2010 at 18:51

2

I need to do some really complex rewrites and I would like not to have to repeat myself too much. PCRE2 conditional substitutions would allow me to do so, but I can't seem to make them work in ngin...
Truthvalue asked 20/5, 2020 at 8:17

1

Solved

We're considering moving from PCRE to PCRE2 as our internal regex engine. Only the regex syntax itself is exposed to our users, so the library APIs differences are not an issue to our uses. However...
Reek asked 8/12, 2021 at 10:1

3

Solved

I installed REGEX support with apt-get install sqlite3 sqlite3-pcre now I can use REGEX in my queries on the bash console like DB="somedb.db" REGEX_EXTENSION="SELECT load_extension('/usr/lib/s...
Schauer asked 10/8, 2016 at 15:34

8

Solved

When installing Apache on Ubuntu 11.10, I get the following error: configure: error: APR not found. Please read the documentation. I followed the instructions here, then, I get the error below...
Attainable asked 19/5, 2012 at 7:17

7

When running uwsgi I got the following message: !!! no internal routing support, rebuild with pcre support !!! I already have installed pcre (I think) with the following command: sudo apt-get inst...
Silly asked 10/2, 2014 at 4:54

5

Solved

I am trying to port a small app of mine from Win XP and VS 2005 to Win 7 and VS 2010. The app compiles and runs smoothly in Debug mode, however in Release mode I get the following error: pcrecpp....
Buffoon asked 31/10, 2010 at 5:7

27

Solved

I'm trying to use sed to clean up lines of URLs to extract just the domain. So from: http://www.suepearson.co.uk/product/174/71/3816/ I want: http://www.suepearson.co.uk/ (either with or without ...
Gaslight asked 9/7, 2009 at 10:47

1

Solved

I was looking though some regex documentation and was confused by something. The (R) condition in the context of (?(R)...|...) is said to be: perl was a little cryptic: (R) Checks if the expressio...
Stephie asked 30/11, 2021 at 10:33

2

Solved

I'm familiar with doing pcre regexes, however they don't seem to work in swift. ^([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})?$ to validate numbers like 1,000,000.00 However, putting this in my...
Arvid asked 7/3, 2015 at 17:37

4

Solved

I'm developing a single serving site in PHP that simply displays messages that are posted by visitors (ideally surrounding the topic of the website). Anyone can post up to three messages an hour. S...
Ulrick asked 3/5, 2009 at 1:53

2

Solved

This question is an educational demonstration of the usage of lookahead, nested reference, and conditionals in a PCRE pattern to match ALL palindromes, including the ones that can't be matched by...
Limpid asked 19/9, 2010 at 16:27

7

It seems to be that the HTML5 spec (and therefore ECMA262) allows <input type="text" pattern="[0-9]/[0-9]" /> to match the string '0/0' even though the forward slash is not escaped. Web appli...
Neddy asked 2/3, 2012 at 1:32

5

In my locale (et_EE) [a-z] means: abcdefghijklmnopqrsšz So, 6 ASCII chars (tuvwxy) and one from Estonian alphabet (ž) are not included. I see a lot modules which are still using regexes like /...
Bombycid asked 12/8, 2012 at 20:12

3

Solved

In the course of processing a large textual chemical database with Perl, I had been faced with the problem of using a regex to match chemical formulae. I have seen these two previous topics, but th...
Waynant asked 13/9, 2017 at 14:34

1

Solved

GNU grep's basic (BRE) and extended (ERE) syntax is documented at https://www.gnu.org/software/grep/manual/html_node/Regular-Expressions.html and PCRE is summarized at man pcresyntax, but the...
Alcot asked 11/6, 2021 at 21:46

5

Solved

for example I have following string: a_b__c___d____e How to preg_replace char _ to char '-', but only if part ' __...' contains more than N repeated _. I hope you understand me )) source: a_b_...
Impropriety asked 17/5, 2011 at 12:59

3

Solved

I'm using regex word boundary \b, and I'm trying to match foo in the following $sentence but the result is not what I need, the underscore is killing me, I want underscore to be word boundary just ...
Blount asked 16/3, 2015 at 2:15

4

Solved

In PCRE2 or any other regex engine supporting forward backreferences, is it possible to change a capture group that matched in a previous iteration of a loop into a non-participating capture group ...
Housman asked 4/1, 2019 at 23:33

2

Solved

I've stumbled upon a regex question. How to validate a subtract equation like this? A string subtract another string equals to whatever remains(all the terms are just plain strings, not sets. So ab...
Cutthroat asked 26/3, 2021 at 8:14

4

Solved

I have a string looks like this #123##1234###2356####69 It starts with # and followed by any digits, every time the # appears, the number of # increases, first time 1, second time 2, etc. It's sim...
Botel asked 12/3, 2021 at 8:31

6

Solved

I am looking at using pcre2 in my simple c++ app, (I am using vs2015). (I am looking at various regex libraries and the general feeling is that pcre/pcre2 are the most flexible) First I downloaded...
Basis asked 15/9, 2015 at 7:22

© 2022 - 2025 — McMap. All rights reserved.