Hejsvej, vill bara ha reda på $1 alltså att den bara skriver ut "kul" och inte resten av stringen...
strText = "Hej hopp lingonsnopp i lingonskogen <div class='headLargeBlack'>Kul</div>"
Set objRegExp = New regexp
objRegExp.Global = True
objRegExp.IgnoreCase = True
objRegExp.Pattern = "\<div class='headLargeBlack'\>(.*?)\<\/div\>"
strText = objRegExp.Replace(strText, "<b>$1</b>")
response.write strText
solbulleMedlem sedan mars 20015 287 inlägg Vet inte riktigt om det är det mest optimala...
<%
strText = "Hej hopp lingonsnopp i lingonskogen <div class='headLargeBlack'>Kul</div>"
Set objRegExp = New regexp
objRegExp.Global = True
objRegExp.IgnoreCase = True
objRegExp.Pattern = "\<div class='headLargeBlack'\>(.*?)\<\/div\>"
Set myMatches = objRegExp.Execute(strText)
For each item In myMatches
Response.Write item.Value
Next
%>
VideMedlem sedan dec. 19998 577 inlägg erik_nordell, vad händer med din kod, ger den något fel eller vad blir resultatet?