PHP
--
Questions
--
Followers
Top Experts
$string = preg_replace('#(<[^>]+[\x0
$string = preg_replace('#([a-z]*)[\x
echo "<br>String is now {$string}<br>";
$string = preg_replace('#([a-z]*)[\x
echo "<br>String is now {$string}<br>";
$string = preg_replace('#([a-z]*)[\x
$string = preg_replace('#([a-z]*)[\x
$string = preg_replace('#(<[^>]+[\x0
$string = preg_replace('#</*\w+:\w[^
Thank you in advance for any assistance.
Gary.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
http://www.regexbuddy.com/tutorial.html
This is helpful, too:
http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/pdf/
FWIW, if you're originating the regular expressions, writing them like this with comments on separate lines helps with the understanding.
// FIND ANY WORD WITH A CHARACTER REPEATED 3 OR MORE TIMES
$rgx
= '#' // REGEX DELIMITER
. '(\w)' // GROUP OF ANY WORD CHARACTER
. '\1' // BACKREFERENCE TO GROUP 1
. '{2,}' // REPEATED TWO OR MORE TIMES
. '#' // REGEX DELIMITER
;
@kaufmed - without your help, I was feeling that I was even more confused - thank you!
Glad to help = )






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Where its going wrong I dont know as there is no decoding utility which shows where a regex is wrong.
Anyone hazard a guess whats wrong in expression 1 as it applies to the others as well they all come up with last_error.
Regexbuddy is decoding the modifiers as part of the expression so Im thinking the expression itself has erroneous syntax.
I'd like to know what the # delimiters mean as there are various including / but cant find any reference elsewhere.
Alistair

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I would suggest opening a new thread = )
PHP
--
Questions
--
Followers
Top Experts
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.