Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: RegEx Help

$
0
0

You can include the alias attribute in much the same way you are including the URL and the link title.

 

For example, to find out if an alias attribute exists, you could add this inside the loop:

<cfset local.alias = REFind('alias="([^"]+)"',local.string,1,true)>

 

Then, if it exists, add it to the struct before you append it to the array:

<cfif val(local.alias.pos[1])>

    <cfset local.this.alias = REReplace(mid(local.string,local.alias.pos[1],local.alias.len[1]),'(a lias=)?"','','ALL')>

</cfif>

 

The example above make certain assumptions, e.g. the alias attribute is in lowercase, the attribute value is enclosed in doublequotes, etc. You may need to adjust if your client's input does not fit that format.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>