|
|
Browse by Tags
All Tags » preg_replace
Showing page 1 of 2 (16 total posts)
-
hi im using PHP and i got this function in my forumsoftware:
function links($text, $conf) {
$text = preg_replace("/(\s)http:\/\/([\S]+?)(\s)/i" , "$1http://$2$3" , " $text ");
$text = ...
-
I have this kind of strings:
{test1|test2|test3}
This is easy to match with something like:
~{(.*?)}~
But I would like to be able to match strings like:
{test1|test2|test3{subtest1|subtest2}}
or
{test1|test2|test3{subtest1|subtest2{subsubtest1|subsubtest2|subsubtest3}}}
I can't figure out how I could match that in the ...
-
Hi, I am using the regex:
$st='@cfcfcf|7a7a7a|777777|6|dedede|858585|fghtytyjtjt@@cfcfcf|7a7a7a|777777|6|dedede|858585|rrrreeee@@cfcfcf|7a7a7a|777777|6|dedede|858585|brown@'
$st = preg_replace('!@.*?brown?@!s', '', $st);
to strip between @ and @ when 'brown' is found. This may or may not be the last in 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 ...
-
Platform: PCRE
Purpose: am trying to teach myself a little PCRE. In particular an expression has been nagging me:
<?php
$text="this-that <a href=\"http://www.my-site.com/index.php\">this-that</a> ...
-
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 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:
/(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi
what I want it to do is if [*code] and [*/code] are around the text inside, ...
-
I'm trying to find words in HTML that are between tags using PHP (v5.2.6) preg_replace.
The following rules apply to the matches
full word match only (can also be matched when adjacent to non-word characters such as commas, parenthesis, periods, question marks, exclamation marks, percentage, dollar signs)
e.g. "test" would ...
-
I need the following string: [Link Name|Link Description] (this is standard mediawiki text for links)
to become this: "Link Description"[Link Name] (this is a proprietary wiki format)
Link Description and Link Name are arbitrary values...it will always be bracket, text, pipe, text, bracket
I'm using php and I've attempted to ...
-
Hi,
Let me explain the scenerio: I have the input text "Mr. XYZ is a very nice person and have a very good taste of humor"
I want to write one replace string and once pattern string such that I can do the following things:
er -> gh
av -> th
these are two papperts that I can match with the pattern string ...
1
|
|
|