How to use a regular expression like Baidu in (ASP + MSSQL) full text search?

zhaozj2021-02-12  137

In ASP MSSQL, I use a full text search multi-keyword (such as "ASP Tutorial") to search, you can get the correct result of "ASP" and "Tutorial" in the article, but I hope that it is like Baidu when it is displayed. The contents of "ASP" and "Tutorial" are displayed, and the keyword is displayed in red. I tried to do with ASP functions, but the effect is always not ideal. Do you want this to achieve this feature? Thank you ...

<% Function Boldword (StrContent, Word) Dim Objregexpset Objregexp = New RegexpobjregExp.Ignorexp.global = true = True

Objregexp.pattern = "(人)" strcontent = objRegexp.replace (strcontent, " $ 1 ") set objRegexp = NothingBoldword = strcontentend

a = "I am Chinese!" b = "Yes"

Response.write Boldword (A, B)%>

转载请注明原文地址:https://www.9cbs.com/read-7477.html

New Post(0)