How would you handle one or more hyphens in words? For instance, "T-cell" is a word,
<cfset w = "T-cell">,
REreplace("a long text string T-cell and more...", "#w#", "<a href=''>#w#</a>")
The above REreplace function failed to identify "T-cell" as one word since hyphen is used as an indicator for a range such as [a-z], according to Adobe documentation, thus, one needs to add the hyphen to the end to reference it as a literal, I attempted to do the following:
REreplace("a long text string T-cell and more...", "#w#-", "<a href=''>#w#</a>") or
REreplace("a long text string T-cell and more...", "[#w#-]", "<a href=''>#w#</a>")
However, it misfired and caused serious problems. What's the correct regExp for this situation?
Many thanks