Documentation
¶
Index ¶
Examples ¶
Constants ¶
const ( // BarsMatch is a regular expression to match Renegade BBS color codes. BarsMatch string = `\|(0[0-9]|1[1-9]|2[0-3])` // CelerityMatch is a regular expression to match Celerity BBS color codes. CelerityMatch string = `\|(k|b|g|c|r|m|y|w|d|B|G|C|R|M|Y|W|S)` // PCBoardMatch is a case-insensitive, regular expression to match PCBoard BBS color codes. PCBoardMatch string = "(?i)@X([0-9A-F][0-9A-F])" )
Variables ¶
This section is empty.
Functions ¶
func Bars ¶
Bars slices a string into substrings separated by "|" vertical bar codes. The first two bytes of each substring will contain a colour value. Vertical bar codes are used by Renegade, WWIV hash and WWIV heart formats. An empty slice is returned when no valid bar code values exists.
Example ¶
package main
import (
"fmt"
"github.com/bengarrett/bbs/internal/split"
)
func main() {
b := []byte("|03Hello |07|19world")
l := len(split.Bars(b))
fmt.Printf("Color sequences: %d", l)
}
Output: Color sequences: 3
func Celerity ¶
Celerity slices a string into substrings separated by "|" vertical bar codes. The first byte of each substring will contain a Celerity colour value, that are comprised of a single, alphabetic character. An empty slice is returned when no valid Celerity code values exists.
Example ¶
package main
import (
"fmt"
"github.com/bengarrett/bbs/internal/split"
)
func main() {
b := []byte("|cHello |C|S|wworld")
l := len(split.Celerity(b))
fmt.Printf("Color sequences: %d", l)
}
Output: Color sequences: 4
func HTMLBars ¶
HTMLBars parses the string for BBS color codes that use vertical bar prefixes to apply a HTML template.
func HTMLCelerity ¶
HTMLCelerity parses the string for the unique Celerity BBS color codes to apply a HTML template.
func HTMLPCBoard ¶
HTMLPCBoard parses the string for the common PCBoard BBS color codes to apply a HTML template.
func PCBoard ¶
PCBoard slices a string into substrings separated by PCBoard @X codes. The first two bytes of each substring will contain background and foreground hex colour values. An empty slice is returned when no valid @X code values exists.
Example ¶
package main
import (
"fmt"
"github.com/bengarrett/bbs/internal/split"
)
func main() {
s := []byte("@X03Hello world")
l := len(split.PCBoard(s))
fmt.Printf("Color sequences: %d", l)
}
Output: Color sequences: 1
Types ¶
This section is empty.