Filtering for a phrase using pregmatch


Posted on 16th Feb 2014 07:03 pm by admin

Here is my code which looks for addresses which start with ' src=" '

Code: [Select]preg_match_all('#src="(http://[^"]+)#', $value, $matches)
I want to modify this so that it only returns matches which contain the phrase "pass". So src="http://www.example.com/blah/pass/edu" would be picked up.

Can someone kindly tell me how to do this? Thank you so much

No comments posted yet

Your Answer:

Login to answer
118 Like 16 Dislike
Previous forums Next forums
Other forums

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Best PHP Documentation generator
Hello guys!

I would like to hear from you what is the best PHP documentation generator. Perso

CHECH A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programm

the problem with str_replace
$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means

Need some ideas as to how to go about sorting this array...
Here's how the array's are created..

Code: <?php
while ($x = readdir($dp)) {

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash