Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Align RegexNew to Visual Studio Code? Get it now.
Align Regex

Align Regex

thangckt

|
24 installs
| (1) | Free
Aligns text lines by a regular expression.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Align Regex

This extension is originally based on vscode-align-by-regex

This extension aligns multiple lines of text by regular expressions. It can align anything, e.g., trailing comments, key-value pairs, or any text patterns defined by regular expressions.

Features

  • Align multiple lines of text by regular expressions.
  • Store regular expressions as templates for repeated use.
  • Run alignment from the editor context menu.
  • Support aligning multiple line selections and cursors simultaneously.

Extension Settings

  • align.regex.templates: Templates for regular expressions used for alignment. The default built-in templates are:
{
    "align.regex.templates": {
        "Multiple signs": "=|,|:",
        "Trailing comments #": "(?<=\\S.*)\\s+#",
        "Trailing comments //": "(?<=\\S.*)\\s+//",
        "Trailing comments %": "(?<=\\S.*)\\s+%",
    }
}

Usage

  • Select multiple lines or multiple cursors
  • Right-click on the editor, and choose Align Regex
  • Select templates or input Regular Expression.

Example 1

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft