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: Beginner:
.* Regular Expression Help!

 



flatgrape
Novice

Apr 10, 2011, 9:00 PM

Post #1 of 2 (594 views)
.* Regular Expression Help! Can't Post

I am just reading RSS files into my script and having trouble with a regular expression for the following:

<source url="http://www.websitehere.com/otherlinks/andstuffinhere=83858393050">Frank Blogs</source>

Each source URL is going to be different understandably.. I am wanting to store the 'Frank Blogs' bit of each different source url though. So far I have, to store the results into an array:

@creator[$count] = $story =~ m#(?<=<source url=.*>)(.*?)(?=</source)#g;

But it isn't working, giving me some sort of warning about Variable length lookbehind not implemented in regex.

I know that to match any character it is '.' and either + or * for many times.

Anyone know what i'm doing wrong?


flatgrape
Novice

Apr 10, 2011, 9:25 PM

Post #2 of 2 (590 views)
Re: [flatgrape] .* Regular Expression Help! [In reply to] Can't Post

Ah sorted. For anyone with a similar problem, this will work:

m#(?:<source url=.*?>)(.*?)(?:</source)#g;

 
 


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

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