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

weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE.

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

LOOPing Problem
Hello All!

The following code loops through the data and displays the data accordingly. My p

Printer configuration
Hi All,
Suppose one of the user deleted the printer settings unfortunatly ,then what is the pro

Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I nee

RadioButtonList item spacing
I have a RadioButtonList and I can't put any spacing between the items. They are arranged verticall

Lack of simpleXML Documentation
What is up with this.

Look at: http://www.php.net/manual/en/function.simplexml-load-file.php<

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