Re: Getting value of SRC in tag between quotes - regex
"Larry Leszczynski" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
Hi Summer -
> I have a need to extract ONLY the contents between the "" in a tag from
> the src.
Take a look at:
http://template-toolkit.org/docs/manual/VMethods.html#method_match
E.g. something like this should work:
[%
somevar = '<img src="getthistextrighthere" id="someid">';
matches = somevar.match('src="([^"]*)"');
src_contents = matches.0;
%]
HTH,
Larry