Option Descriptions
NGW RegEx Generator - Option Descriptions
Welcome to NGW RegEx Generator! This guide provides detailed descriptions of each control and its function to help you get started with text processing and regular expression generation. To be more accurate everything is case-sensitive.
Main Interface Controls
Input and Testing Section
Load RTF Button Purpose: Imports RTF files into the application for processing. Function: Opens a file dialog to select RTF files. Uses background processing to handle large files (up to 50MB) without freezing the interface. Shows a progress bar during loading and warns about large files that may take time to process. Tip: Supports RTF formatting preservation when saving output back to RTF format. If the rtf file is too large for example let's say 140 MB the program may appear to freeze due to the limitations of the rich text editor. However, it eventually will get through the process successfully.
Test Text Box (Rich Text Box) Purpose: Displays the input text to be processed with regex patterns. Function: Shows loaded RTF content with full rich text formatting. Use this area to view and verify your source text before applying regex operations. Right-click for Copy/Cut/Paste context menu. Tip: Times New Roman 12pt font for optimal readability. Supports large text files through background loading.
Test Button Purpose: Applies the selected or generated regex pattern to the test text. Function: Processes the text in the Test Text Box using the active regex pattern. Runs in background to prevent UI freezing, with progress updates. Shows results in the Output Text Box. Handles both predefined patterns and custom generated patterns. Tip: Use this to preview results before saving. Supports replacement and masking operations.
Pattern Generation Section
Examples Text Box Purpose: Input area for creating custom regex patterns from text examples. Function: Enter text examples (one per line) to automatically generate regex patterns. Supports both quoted strings (exact matches) and unquoted patterns (escaped for regex use). Right-click for Copy/Cut/Paste context menu. Examples:
- "exact phrase" - Creates exact match pattern
- word1 - Creates escaped word pattern
- 123_ - Creates numeric pattern Tip: Each line generates a separate pattern; multiple lines create an OR-combined regex.
Generate Button Purpose: Creates regex patterns based on examples and selected options. Function: Analyzes text in the Examples Text Box and selected predefined pattern to generate complete regex expressions. Applies spacing options and combines multiple patterns with OR (|) operators. Populates both the Generated Regex and C# Regex text boxes. Tip: Click after entering examples or selecting a predefined pattern to see the resulting regex.
Predefined Patterns Combo Box Purpose: Quick access to common regex patterns for specific data types. Function: Dropdown selection of built-in patterns for common text processing tasks. Select "None" for custom patterns only. Available Options:
- None - No predefined pattern (use custom examples only)
- Phone Numbers - Detects various international phone number formats
- Social Security Numbers - US SSN format (XXX-XX-XXXX)
- Credit Card Numbers (All) - Detects Visa, MasterCard, Amex, and Discover cards
- American Express - Amex card numbers only
- Discover - Discover card numbers only
- MasterCard - MasterCard numbers only
- Visa - Visa card numbers only
- Duplicate Words - Finds and handles repeated words (e.g., "this this")
Remove Left Spacing Check Box Purpose: Controls whitespace handling before matched patterns. Function: When checked, adds \s* to the generated regex to optionally remove whitespace before matches. Useful for cleaning up inconsistent spacing in source text. Tip: Uncheck to preserve original spacing in output.
Remove Right Spacing Check Box Purpose: Controls whitespace and punctuation handling after matched patterns. Function: When checked, adds \s*(\u200f|\u200b)*(\.)? to handle whitespace, RTL markers, and optional periods after matches. Ideal for cleaning up text with inconsistent formatting. Tip: The pattern includes Unicode RTL (Right-to-Left) markers for international text support.
Replacement and Output Section
Replacement Text Box Purpose: Specifies custom replacement text for matched patterns. Function: Enter text to replace found patterns. If empty, the application uses default behavior (removal for most patterns, masking for sensitive data). Works with both predefined and custom patterns. Examples:
- "[REDACTED]" - Replace sensitive data with redaction marker
- "***" - Simple masking
- "Contact Us" - Replace phone numbers with contact info Tip: Leave empty to remove matches or use with "Mask Sensitive Data" for automatic masking.
Mask Sensitive Data Check Box Purpose: Enables automatic masking for sensitive information. Function: When checked, predefined patterns (phone numbers, SSNs, credit cards) are masked with asterisks instead of being completely removed. Custom patterns are removed when this is checked and no replacement text is provided. Default Masks:
- Phone Numbers: ***-***-****
- SSNs: ***-**-****
- Credit Cards: ****-****-****-**** (format varies by card type) Tip: Use this for data anonymization while preserving text structure.
Output Text Box (Rich Text Box) Purpose: Displays the results after regex processing. Function: Shows the processed text with applied replacements or removals. Maintains RTF formatting from the original input. Scrollable and selectable for review. Right-click for Copy context menu (Paste/Cut disabled to prevent accidental changes). Tip: Use this to verify results before saving. Times New Roman 12pt font matches input for consistency.
Save Output Button Purpose: Exports processed text to a file. Function: Opens a save dialog to export the Output Text Box content as RTF or plain text. Uses background processing for large files with progress indication. Preserves RTF formatting when saving as .rtf files. Supported Formats: RTF (preserves formatting), TXT (plain text) Tip: Always review output in the text box before saving to ensure results meet expectations.
Utility Controls
Clear Examples Button Purpose: Clears content from selected text areas. Function: Clears specified text boxes based on checked options. Requires at least one clear option to be selected. Clear Options (Radio Buttons):
- Clear Examples - Empties the Examples Text Box
- Clear Test - Empties the Test Text Box
- Clear Output - Empties the Output Text Box
- Clear All - Empties all text boxes and resets pattern fields
Copy C# Regex Button Purpose: Copies the C# compatible regex pattern to clipboard. Function: Copies the verbatim string format (@"pattern") from the C# Regex Text Box. Shows confirmation dialog with the copied text. Ideal for direct integration into .NET applications. Tip: Use this for production code - the format is ready to paste into C# projects.
Copy Raw Regex Button Purpose: Copies the raw regex pattern to clipboard. Function: Copies the generated regex pattern without C# formatting. Shows confirmation dialog with the copied text. Useful for other programming languages or regex tools. Tip: This is the "pure" regex without the @"" verbatim string wrapper.
Generated Regex Text Box (Read-only) Purpose: Displays the complete regex pattern with spacing options applied. Function: Shows the final regex pattern generated by the application, including any spacing modifiers from the checkboxes. Read-only to prevent accidental modification. Right-click for Copy context menu. Tip: This pattern includes all modifications (spacing, Unicode handling) for immediate use.
C# Regex Text Box (Read-only) Purpose: Displays C# compatible regex pattern for code integration. Function: Shows the regex pattern formatted as a C# verbatim string literal (@"pattern"). Read-only to maintain code compatibility. Right-click for Copy context menu. Example Output: @"\b(\w+)\s+\1\b" for duplicate word detection Tip: Perfect for copying directly into C# projects without additional formatting.
Additional Features
Progress Bar Purpose: Visual indicator for background operations. Function: Shows loading/saving/processing progress for long-running operations. Appears automatically during file operations and regex testing. Continuous style with percentage completion. Tip: Operations continue even if you switch windows - check back for completion.
NGW Widget Software Link Label Purpose: Access to developer website and support. Function: Click to open www.ngwidgetsoftware.com in your default browser. Provides access to updates, documentation, and additional tools from NEXTGEN WIDGET SOFTWARE. Tip: Check regularly for software updates and new predefined patterns.
Workflow Tips
- Basic Pattern Testing: Load RTF → Enter examples → Generate → Test → Review output
- Sensitive Data: Select predefined pattern → Check "Mask Sensitive Data" → Test
- Custom Replacement: Enter replacement text → Generate/Test → Copy C# pattern for code
- Code Integration: Generate pattern → Copy C# Regex → Paste into your .NET project
Each control is designed to work together seamlessly, providing a complete workflow from text import to regex generation and application. The background processing ensures smooth performance even with large files, while the context menus and copy buttons make integration with other tools effortless.