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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
.* Regular Expression Help!



Apr 10, 2011, 9:00 PM

Post #1 of 2 (1134 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="">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?


Apr 10, 2011, 9:25 PM

Post #2 of 2 (1130 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