Compare commits
No commits in common. "main" and "v0.1.1" have entirely different histories.
1 changed files with 2 additions and 12 deletions
14
script.go
14
script.go
|
@ -1,15 +1,5 @@
|
||||||
package mikrotik
|
package mikrotik
|
||||||
|
|
||||||
import (
|
func Test() int {
|
||||||
// Standard
|
return 137
|
||||||
"regexp"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ScriptEscape(source string) (escaped string) {
|
|
||||||
rxp2 := regexp.MustCompile("([\"\\\\$])")
|
|
||||||
source = rxp2.ReplaceAllString(source, "\\$1")
|
|
||||||
|
|
||||||
rxp := regexp.MustCompile("\\r?\\n")
|
|
||||||
escaped = rxp.ReplaceAllString(source, "\\r\\\r\n \\n")
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue