package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?ims)LLPart1:(.*?)LLPart2`)
var str = `BundleFormat: 1
Name: TestIllegalStringsLintalist
Description: Created just to see what strings Lintalist uses
Author: Gurlan Vasile
TitleMatch: .txt
Patterns:
- LLPart1: [[Calendar=]]
LLPart2: >>date
LLKey:
LLShorthand: >>calendar
LLScript:
- LLPart1: Syntax:
__multilinevar --> create multiline variable
Notepad++:
__lngAuto --> Notepad++ : change language to Autohotkey
AHK Studio:
__refresh --> AHK Studio : refresh project
Other:
__tgs --> any editor : paste tags template
__newcode --> any editor : create code for Lintalist to be displayed properly
__lintalist --> any editor : create code for Lintalist to be displayed properly
LLPart2:
LLKey:
LLShorthand: >>>?
LLScript:
- LLPart1: messagebox show
LLPart2:
LLKey:
LLShorthand:
LLScript: MsgBox, Test
- LLPart1: wfaw
LLPart2: fwa
LLKey:
LLShorthand:
LLScript:
- LLPart1: some code here
LLPart2: some descriptive text here
LLKey:
LLShorthand: smcd
LLScript: msgbox, HelloWorld
`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/