Tagged Questions
2
votes
0answers
188 views
PHP E_ERROR on preg_replace: regexp code has no debug info
I can't figure out why an E_ERROR is logged when running through the script using a debugger - since it does not appear in my errorlog when the script runs normally, I would assume that it is ...
1
vote
0answers
52 views
php regex change youtube links to videos
I have functions that change links into clickable links and one that changes youtube links into embedded videos.
However, if you post a youtube video first then a regular link, all links turn into ...
1
vote
0answers
34 views
Mod_ReWrite regex unknown variables count?
i store uploaded files at /storage/ this way
public-adam-luki-uploads-123783.jpg
park-hanna-adel-propic-uploads-787689.jpg
the '-' count unknown because it slice the pic description
i want my ...
1
vote
0answers
38 views
Regular expression matching unescaped paired brackets and nested function calls
Here's the problem: given a string like
"<p>The price for vehicles {capitalize(pluralize(vehicle))} is {format_number(value, ...
1
vote
0answers
80 views
Word Boundary Regular Expression Unless Inside HTML Tag
I have a regular expression using word boundaries that works exceedingly well...
~\b('.$value.')\b~i
...save for the fact that it matches text inside HTML tags (i.e. title="This is blue!"). It's a ...
1
vote
0answers
68 views
PHP preg_func/u or mb_ereg_func for UTF8? (regular expressions with multi-byte-PCRE or multi-byte-POSIX?)
All these questions are similar, having (my guess) a similar answer:
The ereg functions, which are POSIX, have been DEPRECATED (as of PHP 5.3.0). So, why do we need to use POSIX, if the PHP ...
1
vote
0answers
174 views
Walking Dom in PHP to replace a list of string found into “HTML text”
I would like to replace a word list (in array) in a list of links (hrefs in array) into an html page.
I think mostly have 2 options:
Doing this from regular expressions (strongly discouraged to ...
1
vote
0answers
128 views
Apache RewriteMap not working
I'm trying to rewrite some of my URLs using an apache RewriteMap.
I'd like to transform
www.mywebsite.com/?p=category&id=xxxx
in
www.mywebsite.com/category/channel/program/personnality
I ...
1
vote
0answers
131 views
PHP PCRE - match different subpattern name depending on context
As the title states, I started thinking about how to match, for example, 2 different subpatterns in a regex applied on a string, on the condition that if the content has only numbers it will be ...
1
vote
0answers
159 views
Fulltext search with typos: levenshtein-fulltext?
I have a mysql table with the following columns
City Country Continent
New York States Noth America
New York Germany Europe - considering there's one ;)
Paris France Europe
If I ...
1
vote
0answers
101 views
Efficiently replace a pattern, but not when masked
Wiki-formatting in some kind makes it easy for users to avoid HTML: **bold** oder //italic// for example. What I am looking for is an efficient way to replace such formatting codes with HTML code ...
1
vote
0answers
283 views
PHP front controller in nginx
I have a wiki that hosts user-generated content with URLs like /wiki/view/pagename and /wiki/modify/pagename. I'm using an nginx configuration that goes something like:
location /wiki/ {
...
1
vote
0answers
89 views
PHP preg_replace_callback REGEX (.*?) fails to match
I'm trying to match/replace the following input text with regular expressions in PHP:
{#var1>var2}
{#>empty}inside empty{#>empty}
before rows
{#>firstrow}inside ...
1
vote
0answers
256 views
Wrong pattern in WP rewrite_rules_array hook
The following code chunk will be well known by WP coders working with permalinks.
add_filter('rewrite_rules_array', array($this, 'insert_rewrite_rules'));
function insert_rewrite_rules($rules)
{
...
1
vote
0answers
191 views
PHP code to extract column names and alias names in a complex mysql query
I have a select query in PHP program.
SELECT u.name AS name,
u.email AS email,
u.status AS status ,
u.is_blocked AS is_blocked,
pm.plan_name AS plan_name,
upt.amount AS ...