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 Go
Compare with Rust
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.cpp
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
^name$# Confirm multiline/end-boundary behavior for the named engine.
Flags are supplied when constructing the regex. icase and C++17 multiline are distinct from dot-all behavior, which has no equivalent standard flag. multiline arrived late in some standard libraries, so check ^/$ behavior on yours before relying on it.
std::regex has no standard escape helper. For literal substring search, prefer string::find; use a reviewed grammar-specific quoting routine only when regex composition is required.
Standard narrow std::regex does not provide the same Unicode property syntax. Choose an explicitly Unicode-aware library such as ICU when that is a requirement.
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.
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.cpp
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.cpp
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
NFC/NFD: canonical normalization formsCase folding: a separate language/Unicode policy