rebies
asked on
Regular Expression Help
I’ve never been good with Regular Expressions. Can someone help me here? I have a ton of HTML, and I’m trying to extract all of the link titles from this page.
So a portion of my page looks like…
----
<a href="linkout.cfm?theid=10 0000">this is the title</a> <a href=" linkout.cfm?theid=100000"> title</a> <a href=" linkout.cfm?theid=100000"> yet another title</a> outside text <a href="linkout.cfm?theid=10 0000">last title</a>
----
And I want to get the result of an array, or comma separated titles like:
this is the title
title
yet another title
last title
Any help here? I am pretty sure this should be fairly easy for someone that understands regular expressions better than I do.
Thanks.
Andrew
So a portion of my page looks like…
----
<a href="linkout.cfm?theid=10
----
And I want to get the result of an array, or comma separated titles like:
this is the title
title
yet another title
last title
Any help here? I am pretty sure this should be fairly easy for someone that understands regular expressions better than I do.
Thanks.
Andrew
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dan, that seems to be exactly what I was looking for. I could not understand how I was to find the match, then get it out of there. But backreferancing with Match.pos[2] and Match.len[2] does the trick!
Thanks. Answer accepted.
Thanks. Answer accepted.
ASKER
Sorry, meant to say "Dain,"...
No problem -- I've been called worse! :-)
-Dain
-Dain
take a look at this
<script language="JavaScript" type="text/javascript">
function getLinks(){
linkArray=document.links;
for(x=0;x<linkArray.length
document.getElementById('m
}
}
</script>
<input type="button" onClick="getLinks()" value="Get Links">
<div id="myDiv"></div>
<CFHTTP URL="http://www.yahoo.com"
METHOD="get"
RESOLVEURL="Yes"></CFHTTP>
<cfoutput>
#CFHTTP.FileContent#
</cfoutput>