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 "...
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
...
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...
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...
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...
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...
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...
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...
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...
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...
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
/...
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...
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...
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...
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...
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
1 Next >
© 2022 - 2025 — McMap. All rights reserved.