CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
very new to perl and programming

 



chawk
New User

Feb 17, 2011, 6:19 PM

Post #1 of 2 (2323 views)
very new to perl and programming Can't Post

I am trying to create a regular expression that will take the

"http://www.flickr.com/photos/23337560@N06/2278680802/"

and replace it with

"http://farm3.static.flickr.com/2064/2278680802_d6d6c0b68d.jpg"


here is the embed code

<a href="http://www.flickr.com/photos/23337560@N06/2278680802/" title="Jack O'Shea - Bayside by xerex//, on Flickr"><img src="http://farm3.static.flickr.com/2064/2278680802_d6d6c0b68d.jpg" width="358" height="500" alt="Jack O'Shea - Bayside" /></a>

Code

Quote


jassics
Novice


Feb 17, 2011, 11:45 PM

Post #2 of 2 (2317 views)
Re: [chawk] very new to perl and programming [In reply to] Can't Post


Quote
I am trying to create a regular expression that will take the

"http://www.flickr.com/photos/23337560@N06/2278680802/"

and replace it with

"http://farm3.static.flickr.com/2064/2278680802_d6d6c0b68d.jpg"


If its only for this situation use substitute ex:

Code
$sub_part =~s/old/new/;


But If you would define the pattern, may be Perl mongers can write better Regex for that.
Hack to learn! Don't Learn to Hack!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives