Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.
Scope and conventions
TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.
No comparison
Compare with TypeScript
Compare with Rust
Compare with C++
Patterns & regex
TypeScript uses JavaScript RegExp; Go uses regexp; Rust uses the optional regex crate; C++ uses std::regex with its default ECMAScript grammar. Pattern rows show regex text; API rows show host-language escaping.
A greedy quantifier prefers more input when a match is possible. Appending ? makes it prefer less. Lazy repetition is not a substitute for choosing a correct grammar.
| separates alternatives; group them when only part of a pattern should vary. Default alternatives are tried in order, under each engine’s matching policy.
^ and $ are boundary assertions, not matched characters. Their line behavior depends on multiline flags. Use the engine’s full-match contract when validating an entire input.
Fragment
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
^name$# Confirm multiline/end-boundary behavior for the named engine.
FindStringSubmatch returns the whole match at index 0 followed by groups, or nil for no match. Use index APIs when unmatched versus empty groups matter.
Fragment
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
import "fmt"parts := re.FindStringSubmatch(input)if parts != nil { fmt.Println(parts[0]) }
A pattern such as a* can match without consuming input. Use a documented iterator API rather than writing a loop that retries the same empty match forever.
Go regexp guarantees linear-time matching in input length for a fixed compiled pattern. Compilation size and the work you do for all matches still consume resources.
Fragment
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
Compile a reusable pattern once; bound input/output sizes.
Regex is useful for bounded token recognition and extraction. JSON, CSV, HTML and nested-language parsing need their format rules, escaping and error handling.
Fragment
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
CSV: a quoted field can contain a comma or newlineJSON: strings can contain escaped delimiters
Unicode normalization and case policies can change which strings are considered equivalent. Normalize only under an explicit domain contract; matching alone does not establish semantic identity.
Fragment
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
NFC/NFD: canonical normalization formsCase folding: a separate language/Unicode policy