| Regex Tools |
| grep |
| PowerGREP |
| RegexBuddy |
| RegexMagic |
| General Applications |
| EditPad Lite |
| EditPad Pro |
| Google Docs |
| Google Sheets |
| LibreOffice |
| Notepad++ |
| Databases |
| Google BigQuery |
| MySQL |
| Oracle |
| PostgreSQL |
TypeScript is a strongly typed programming language that builds on JavaScript. As such, it uses the same RegExp object as JavaScript. Everything that is said about JavaScript regular expressions tutorial and reference on this website also applies to TypeScript.
The only difference, really, is that your TypeScript code benefits from explicitly declaring the types of your variables. For example, in TypeScript you could retrieve the details of how a regex matches a string as follows:
var match: RegExpMatchArray | null = subject.match(/regular expression/);
if (match !== null) {
// matched text: match[0]
// match start: match.index
// capturing group n: match[n]
} else {
// Match attempt failed
} If you wanted to separately declare the RegExp variable for possible reuse, then you could replace the first line in the above code snippet with these two:
var myregexp: RegExp = /regular expression/; var match: RegExpExecArray | null = myregexp.exec(subject);
Notice that the type of match is actually different. But the properties for retrieving the match details are the same with both types.
| Quick Start | Tutorial | Search & Replace | Tools & Languages | Examples | Reference |
| grep | PowerGREP | RegexBuddy | RegexMagic |
| EditPad Lite | EditPad Pro | Google Docs | Google Sheets | LibreOffice | Notepad++ |
| Boost | C# | Delphi | F# | GNU (Linux) | Groovy | ICU (Unicode) | Java | JavaScript | .NET | PCRE (C/C++) | PCRE2 (C/C++) | Perl | PHP | POSIX | PowerShell | Python | Python.NET and IronPython | R | RE2 | Ruby | std::regex | Tcl | TypeScript | VBScript | Visual Basic 6 | Visual Basic (.NET) | wxWidgets | XML Schema | XQuery & XPath | Xojo | XRegExp |
| Google BigQuery | MySQL | Oracle | PostgreSQL |
Page URL: https://www.regular-expressions.info/typescript.html
Page last updated: 11 October 2025
Site last updated: 29 October 2025
Copyright © 2003-2025 Jan Goyvaerts. All rights reserved.