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.
Did you know?Explore Trending and Topic pages for more stories like this.

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

setcookie and isset($_COOKIE(name)) seem very finnicky.
I'm currently playing around with a user system with login and registration. I'm trying to use cooki

Matchcode in ALV change header column
Hello everyone,

I am working in an SAP system that is currently in upgrade and conversion

Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Cu

Shuffle Array
Hi,

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

MS Access data into a html table
Hi everyone, I am quite a novice at php but I have created some helpful scripts that fetch data
f

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

PHP & Java
Hello,

can PHP code be used inside java code?

Code: [Select]<SCRIPT LANGUAGE=&q

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

Weekly Calendar
Hi, I am looking at creating a weekly calendar. The calendar will read from Monday - Sunday. Does an

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