Catalog / Regex & Text Manipulation in IDEs/Editors
Regex & Text Manipulation in IDEs/Editors
A quick reference guide to using regular expressions and text manipulation features within popular Integrated Development Environments (IDEs) and text editors, streamlining coding and text editing tasks.
Basic Regex Operations
Finding Text
Find/Search |
Locates the first or next occurrence of a specified text or regex pattern. Example: |
Find All |
Highlights or lists all occurrences of a specified text or regex pattern. Example: |
Incremental Search |
Starts searching as you type, immediately jumping to the first match. Example: |
Replacing Text
Replace |
Replaces the first found occurrence of a pattern with a specified replacement string. Example: |
Replace All |
Replaces all occurrences of a pattern with a specified replacement string. Example: |
Replace with Regex |
Allows using regular expressions both for finding and replacing text, enabling complex transformations. Example: |
Common Regex Symbols
|
|
|
|
|
|
|
Advanced Regex Features
Character Classes
|
Matches any digit (0-9). Example: |
|
Matches any word character (a-z, A-Z, 0-9, and underscore). Example: |
|
Matches any whitespace character (space, tab, newline). Example: |
|
Matches any non-digit character. Example: |
|
Matches any non-word character. Example: |
|
Matches any non-whitespace character. Example: |
Anchors
|
Matches the beginning of a line. Example: |
|
Matches the end of a line. Example: |
|
Matches a word boundary (the position between a word character and a non-word character). Example: |
Quantifiers
|
Matches exactly n occurrences of the preceding character or group. Example: |
|
Matches n or more occurrences of the preceding character or group. Example: |
|
Matches between n and m occurrences of the preceding character or group. Example: |
Text Manipulation Techniques
Case Conversion
Uppercase |
Convert selected text or the entire document to uppercase. Example: |
Lowercase |
Convert selected text or the entire document to lowercase. Example: |
Title Case |
Convert selected text to title case (capitalize the first letter of each word). Example: |
Indentation and Formatting
Auto-Indent |
Automatically adjusts indentation based on the code structure. Example: |
Reformat Code |
Applies predefined code style rules to the entire document or selection. Example: |
Tab/Untab |
Insert or remove tabs/spaces at the beginning of lines. Example: |
Line Operations
Join Lines |
Combine selected lines into a single line. Example: |
Split Lines |
Split a line at the cursor position into two lines. Example: |
Duplicate Lines |
Duplicate the selected lines. Example: |
Delete Line |
Deletes the current line. Example: |
IDE-Specific Features
Visual Studio Code
Multi-Cursor Editing: Alt+Click to add multiple cursors for simultaneous editing. |
Column (Box) Selection: Shift+Alt+Drag to select text in a column. |
Find and Replace: Ctrl+F for find, Ctrl+H for replace, supports regex. |
Format Document: Shift+Alt+F to format the entire document. |
Sublime Text
Multi-Selection: Ctrl+Click to add multiple selections for simultaneous editing. |
Column Selection: Ctrl+Shift+Up/Down to select text in a column. |
Find and Replace: Ctrl+F for find, Ctrl+H for replace, supports regex. |
Reindent Lines: Edit -> Line -> Reindent to fix indentation. |
IntelliJ IDEA
Column Selection Mode: Alt+Shift+Insert to toggle column selection mode. |
Multiple Cursors: Alt+Click to create multiple cursors. |
Find and Replace: Ctrl+F for find, Ctrl+R for replace, supports regex. |
Reformat Code: Ctrl+Alt+L to reformat the code. |