Browse by Tags
Showing page 2 of 13 (128 total posts)
I have a CMS which is written to output xhtml. I am trying to write a php script that will convert the system - completely and permanently - to output html instead. The sticking point is creating a regex to find self-closing xhtml tags (e.g., <img /> ) and convert them to non-self-closing html tags (e.g., <img>). I am ...
I'm writing some data miners that extract data from tables on financial websites, and I've hit a brick wall.
One of the data sets I need to get is a fairly large table, however when i use the following I get nothing back:
Looking at the ...
Hi regex experts,
I’m searching for a regular expression for PHP’s preg_replace() in order to adjust concatenated strings (no multi-line).
These strings are fragments in German which form a sentence and therefore need to be (automatically) edited to adhere to grammar conventions.
Roughly speaking, the regular expression should ...
I would like to implement a regex of the rules found here for showing a word in its syllables http://www.phonicsontheweb.com/syllables.php
So far, I've got:
//lowercases the word, taking out anything other than letters
$word = preg_replace('/[^a-z]/is', '', strtolower($word));
//split at: vowels, double ...
what i'm trying to do is remove all line breaks in and around certain html (or xml if you will) elements (h[0-9], ul, li) from a string
the following works fine for removing leading and trailing line breaks, but not the ones inside the element:
$text = ...
I have a string like this:
$ maCahine = (1 and 2 or 3)
I have a php regexp:
$ reg = "# (\ () (0,1) \ s * $ number \ s * (and | or | \)) # i
to replace the number by string has provided the number preceded by "(" and follow either by AND or OR or ").
then I use php preg_replace function to replace.
but I ...
We tried to figure that out, but we could not find a solution yet. So please give us some kind of advice.
These are the essential lines:
RewriteRule ([a-zA-Z0-9]+)/([a-zA-Z0-9]+)\.html$ index.php?tp=$1&up=$2 [L]
RewriteRule ([a-zA-Z0-9]+)/$ index.php?tp=$1 [L]
RewriteRule ([a-zA-Z0-9]+)$ index.php?tp=$1 [L] ...
I'm pretty new to regexes and I've got a small problem. I have the following regex: (?<=lblVacant">(ab )?)([\d,.\/]+)(?=(<\/span>|\s\-)) which should match ose1_DetailEstateData1_lblVacant">06.08.2009 - 30.10.2009</span></td>
ailEstateData1_lblVacant">10.08.2009 - ...
I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works:
what I want it to do is if [*code] and [*/code] are around the text inside, ...
I need help with a regular expression in PHP, I have made a small forum, and I am adding features, up until now whenever someone types a url "http://..........." I use a regex to make a link, but now I have new features, one of them is adding youtube videos, to do this I ask my members to simply type youtube(youtube_url)
the problem is ...