mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-02 07:25:26 +08:00
13 lines
256 B
Go
13 lines
256 B
Go
package textclean
|
|
|
|
import "regexp"
|
|
|
|
var referenceMarkerPattern = regexp.MustCompile(`(?i)\[reference:\s*\d+\]`)
|
|
|
|
func StripReferenceMarkers(text string) string {
|
|
if text == "" {
|
|
return text
|
|
}
|
|
return referenceMarkerPattern.ReplaceAllString(text, "")
|
|
}
|