Omgili - forum search, search forums  
  

Discussions about preg

Displaying 1 - 10 out of 12,037 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Hi, I get this warning from php after the change from split to preg_split for php 5.3 compatibility : PHP Warning: preg_split(): Delimiter must not be alphanumeric or backslash the php code is : $statements = preg_split("\\s*;\\s*", $content); How can...
Started by on , 3 posts by 3 people.  
However, PHP itself doesn't support this ....
Functions) inherit this.
preg_split("/\s*;\s*/", $content); Although the question was tagged as answered two minutes after: /\s*;\s*/Ui PHP's Perl-compatible regular expressions (aka preg_...
Hello, I have some data similar to this: aaa1|aaa2|ZZZ|aaa3|aaa4|aaa5|ZZZ|aaa6|aaa7 I want to match all "aaa[0-9]" BETWEEN "ZZZ" (not the ones outside). So I have some PHP code: $string = "aaa1aaa2zzzzaaa3aaa4aaa5zzzzaaa6aaa7"; preg_match_all("/zzzz.*...
Started by on , 3 posts by 3 people.  
If (preg_match('/zzzz(.*?)zzzz/', $string, $matches)) { preg_match_all('/(aaa\d)/', $matches[1 = "aaa1aaa2zzzzaaa3aaa4aaa5zzzzaaa6aaa7"; preg_match_all("/aaa[0-9](?=.*?zzzz)(?!(?>.*?zzzz).*?zzzz)/", $string, $matches, PREG....
I'm trying to find some certain blocks in my data file and replace something inside of them. After that put the whole thing (with replaced data) into a new file. My code at the moment looks like this: $content = file_get_contents('file.ext', true); //...
Started by on , 4 posts by 4 people.  
You don't even need the preg_replace; because you've already got the matches you can just use blocks first preg_match_all('/regexp/su', $content, $matches); foreach ($matches[0] as $match'); $content = preg_replace('/match/', 'replacement....
Ask your Facebook Friends
I'm trying to do a simple task of altering thousands of music video embed codes with a common with/height. For example, I have the following code: <object width="480px" height="407px" > <param name="allowFullScreen" value="true"/> <param...
Started by on , 3 posts by 3 people.  
$new_width.
Here's how to get the width and height preg_match('/width="(\d+)(px)?" height="(\d+)(px)?"/', $text: $text = preg_replace('/width="(\d+)(px)?" height="(\d+)(px)?"/', 'width="' .
I have a text file that I am displaying in a table. I am using preg_match_all to find a specific Title with a specific Chapter and I am replacing the Title and Chapter with preg_replace to make it a link.. For example the contents within the text file...
Started by on , 3 posts by 3 people.  
Dec 04 12:13 50 x 50 44 STR; preg_match_all('/\w{3}\s\d{2}\s\d{2}:\d{2}\s(.+)?\s(\d{2,})/', $s, $m", $filedata); echo "<table border=\"1\">"; foreach($lines as $line) { echo "<tr>"; preg_match.
Hi , really simple question how can I preg_replace the backslash charactor ?
Started by on , 5 posts by 5 people.  
Alternatively....
Escape \ with \ : \\ preg_replace('/\\/', 'REMOVED BACKSLASH', 'sometest\othertest'); You need to escape the backslash: \\ From the manual on preg_replace() : To use backslash in replacement, it must be doubled ("\\\\" PHP string).
How do I replace a single question mark with preg replace.
Started by on , 4 posts by 4 people.  
preg_replace('/\?/', 'replacement', $original, 1) If it's a single character you're replacing, you may not need a preg_ solution: a "simple" str_replace may do the trick as well: www.php.net/str" $new = preg_replace('/(?<!\?)\....
Preg_match gives one match. Preg_match_all returns all matches. Preg_split returns all splits. How can I split only the first match? Example: preg_split("~\n~",$string); This is what I want: array(0=>'first piece',1=>'the rest of the string without...
Started by on , 4 posts by 4 people.  
Thanks to Ben James for mentioning: preg_split array(substr($string,0,$fp), substr($string,$fp)); Or you can if you insist on preg_split(); : $fp = strpos($string,"\n"); $arr = preg....
Simply set $limit to 2 for 2 parts of the array .
$line = "Hello World"; $line= preg_replace("/Hello/", $replacement, $line); - Works! $find = "Hello"; $line= preg_replace("/$find/", $replacement, $line); - Wont replace anything! $string = "Hello"; $find = "/".$string."/"; $line= preg_replace($find, ...
Started by on , 3 posts by 3 people.  
If you are using different strings, with special characters, be sure to run a preg."/"; print_r( preg_replace($find, $replacement, $line) ); ## output: Bye World Can you provide more.
If they wouldn't.
How can i get 41P86246HOH7C1G4A983321910HDL63U9 from the following with preg_match input type="text" value="41P86246HOH7C1G4A983321910HDL63U9" id=""
Started by on , 6 posts by 6 people.  
Id=""'; $m = array(); if (preg_match('#value="([^"]+)"#', $str, $m)) { var_dump($m[1]); } Which'); With something like this: if(preg_match('@value="([^"]*)"@', $text, $m)){ echo $m[1]; } But you){ $attrs = array(); if(preg_match....
Page: 1   2   3   4   5   6   7   8   9   10  
Related Searches
php preg strong password    incest preg pics    php preg_match search special character   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost