Using Dotstar · Part 9
Code
The Code tab writes the pattern, its flags and the replacement into code you can paste, for 24 languages: JavaScript, TypeScript, Dart, Python, PHP, Perl, Ruby, Java, Kotlin, C#, F#, Visual Basic, PowerShell, Go, Rust, Swift, C++, C, Lua, Vim script, Emacs Lisp, the shell (grep and sed), VBA and VB6, and VBScript.

What it writes
Choose the language, and what the code should do: test whether the text matches, find the matches, replace (with Replace on), or unit tests from the Tests tab. The code has the escaping each language’s strings need (the backslashes a Java string doubles, Python’s raw strings), and the flags as that language spells them. The code is coloured as an editor colours it, and Copy takes it as written.
Converted, and checked
The languages that run the flavor’s own engine come first. For the others the pattern is converted, with notes on anything that changes. Where Dotstar has the language’s engine (Python, PHP, Perl, Ruby, Java and Kotlin, the .NET languages, Go, Rust, Swift, C, C++, Lua, Vim script, Emacs Lisp, VBA and VBScript), it runs the converted pattern there on your text, and says whether it finds the same matches, or where they differ.
Unit tests
Unit tests writes the Tests tab’s strings as tests in the language’s usual framework: Vitest or Jest, pytest, PHPUnit, JUnit, xUnit, Go’s testing, Rust’s #[test], XCTest, Minitest, Test::More, Pester, ERT, or plain asserts where there’s none. The pattern then keeps its tests in your project too.
Code in other engines’ languages is in Dotstar Pro.