RegexDesigner.NET Overview

RegexDesigner.NET
Overview

Welcome To RegexDesigner.NET

RegexDesigner.NET is a powerful visual tool for helping you construct and test .NET Regular Expressions. When you are happy with your regular expression, RegexDesigner.NET lets you integrate it into your application through native code generation and compiled assemblies.

Getting Started

To help you get started with RegexDesigner.NET, take a look at Using RegexDesigner.NET.

Managing Projects

RegexDesigner.NET stores your regular expression details in "projects". Look at Managing Projects to learn how to manage them.

Regular Expressions

RegexDesigner.NET allows you to perform Match, Replace and Split operations, as well as regular expression code-generation and assembly compilation. Find out more in Regular Expressions.

Purchasing

If you would like to purchase RegexDesigner.NET, let us know.

Licencing

Please read the Sells Brothers RegexDesigner.NET License if you intend to keep using it.


License

RegexDesigner.NET
License

LICENSE GRANT

"You" or "your" as used herein means the person or company who is being licensed to use the Software, as defined below. "We," "us" and "our" as used herein means Sells Brothers, Inc. We hereby grant you a nonexclusive, non-transferable, revocable license to use one copy of the Software on any single computer, provided the Software is in use on only one computer at any time. The Software is "in use" on a computer when it is loaded into temporary memory (RAM) or installed into the permanent memory of a computer--for example, a hard disk, CD-ROM or other storage device.

  • If you purchase the Software Multiple User License, the total number of users who have permission to access the software over a network shall be limited to the number of users as specified in the purchase agreement.
  • If you purchase the Software Site License, all users who work at a single street address shall be permitted to access the software.

TITLE

The "Software" as referred to herein means the Sells Brothers, Inc. software "RegexDesigner.NET", a client-based software product that allows a user to construct and test .NET Regular Expressions in a Graphical User Interface (GUI) environment. The Documentation as referred to herein shall mean the written materials that you may receive in connection with the Software. We will remain the sole and exclusive owners of all right, title and interest in and to the Software and the Documentation.

ARCHIVAL OR BACKUP COPIES

You may copy the Software for back-up and archival purposes only, provided however, that at all times herein, the original and each copy is kept in your possession and that your installation and use of the Software does not exceed that allowed in the "License Grant" section above.

THINGS YOU MAY NOT DO

You agree and acknowledge that the Software and Documentation are proprietary works that may be protected by the copyright laws of various nations. You may only use the Software and Documentation for the purposes and in accordance with the terms of this Agreement. You may not, without limitation:

... copy the Documentation,
... copy the Software except to make archival or backup copies as provided above,
... place the Software onto a server so that it is accessible via a public network such as the Internet,
... sublicense, rent, lease or lend any portion of the Software or Documentation.

You acknowledge that any violation of this paragraph will cause us immediate and irreparable harm and that the damages which we will suffer may be difficult or impossible to measure. Therefore, upon any actual or impending violation of this paragraph, we shall be entitled to the issuance of a restraining order, preliminary and permanent injunction without bond, restraining or enjoining such violation by you, your successors or assigns or any entity or person acting in concert with you. Such remedy shall be additional to and not in limitation of any other remedy which may otherwise be available to us by law.

TRANSFERS

You may assign all your license to use the Software and Documentation to another person or legal entity (the "Assignee"), provided however, that prior to such assignment, the Assignee undertakes in writing to be bound by your obligations under this Agreement. Any attempt to assign or transfer the license to the Software, the Documentation or this Agreement shall be ineffective, unless the assignment complies with the terms of this paragraph. Upon assignment of your license hereunder, you agree to transfer to the Assignee all of your copies of the Software and Documentation, including all copies of updates and prior versions of the Software and Documentation and you further agree and that you will retain no copies, including, without limitation, electronic copies stored on computer discs or drives.

DISCLAIMER OF WARRANTY

THE SOFTWARE AND SERVICES OFFERED BY US ARE PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS WITHOUT WARRANTIES OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, NONINFRINGEMENT MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WE DO NOT WARRANT THAT THE SOFTWARE WILL BE- UNINTERRUPTED, TIMELY, RELIABLE, SECURE OR ERROR-FREE AND EXPRESSLY DISCLAIM ANY WARRANTIES AS TO THE MATERIALS CONTAINED THEREIN, THE SERVERS USED OR THE GOODS OR SERVICES OFFERED BY US.

EXCLUSION OF CERTAIN DAMAGES

IN NO EVENT WILL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM THE USE OR THE INABILITY TO USE THE SOFTWARE (EVEN IF WE OR AN AUTHORIZED DEALER OR DISTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF THESE DAMAGES), OR FOR ANY CLAIM BY ANY OTHER PARTY.

TERM AND TERMINATION

This Agreement takes effect upon your acceptance of the terms of this Agreement and remains effective until terminated by either party in accordance with this Agreement. You may terminate this Agreement at any time by destroying all copies of the Software and Documentation in your possession and giving us prompt notice of same. This Agreement will automatically terminate if you fail to comply with any term or condition of this Agreement. Upon termination of this Agreement, you warrant and represent that you will immediately destroy all copies of the Software and Documentation or other materials provided to you hereunder, if any, that are still in your possession and provide us prompt written assurance of same.

CONFIDENTIALITY

Non Disclosure. You agree and acknowledge that the Software, its algorithms, protocols or interfaces, and the Documentation constitute proprietary and confidential information that belong to us (the "Confidential Information"). You also understand and agree that misuse and/or unauthorized disclosure of our Confidential Information could adversely affect our business. Accordingly, you agree that at all times you will (a) use and reproduce the Confidential Information only for the purposes of this Agreement and only to the extent necessary for such purpose; (b) restrict disclosure of the Confidential Information to your employees, consultants or independent contractors with a need to know and (c) not disclose the Confidential Information to any third party without our prior written approval. Notwithstanding the foregoing, it shall not be a breach of this Agreement for You to disclose Confidential Information if required to do so under law or in a judicial or other governmental investigation or proceeding, provided however, that You give us prior notice of the disclosure sought and You seek all reasonably available safeguards against widespread dissemination prior to such disclosure.

Remedies. You acknowledge that any violation of this paragraph will cause us immediate and irreparable harm and that the damages which we will suffer may be difficult or impossible to measure. Therefore, upon any actual or impending violation of this paragraph, we shall be entitled to the issuance of a restraining order, preliminary and permanent injunction without bond, restraining or enjoining such violation by you, your successors or assigns or any entity or person acting in concert with you. Such remedy shall be additional to and not in limitation of any other remedy which may otherwise be available to us by law.

GENERAL PROVISIONS

  1. This Agreement constitutes the entire agreement between you and us concerning the Software and Documentation and supersedes any prior or contemporaneous negotiations, discussions, understandings, purchase orders, communications, advertising or representations concerning the subject matter hereof.
  2. This Agreement may be modified only by a writing signed by you and us.
  3. In the event of litigation between you and us concerning the Software or Documentation, the prevailing party in the litigation will be entitled to recover attorneys' fees and expenses from the other party.
  4. This Agreement shall be governed by the laws of the state of Oregon, excluding its choice of law rules.
  5. You agree that the Software will not be shipped, transferred or exported into any country or used in any manner prohibited by the United States Export Administration Act or any other export laws, restrictions or regulations.
  6. All disputes arising out of or in connection with this Agreement shall be submitted to arbitration under the Rules of Conciliation and Arbitration of the International Chamber of Commerce (the "ICC"). The arbitrator or arbitrators shall be chosen in accordance with the ICC rules. The arbitration proceedings shall take place in Portland, Oregon. Unless otherwise agreed between the parties, the language of all arbitration proceedings shall be English. Judgment on the award of the arbitrator (s) may be entered in any court of competent jurisdiction.


About The Authors

RegexDesigner.NET
About the Authors

Chris Sells in an independent consultant, specializing in distributed applications in .NET and COM, as well as an instructor for DevelopMentor. He's written several books, including ATL Internals, which is in the process of being updated for ATL7 right now. He's also working on Essential Windows Forms for Addison-Wesley and Mastering Visual Studio .NET for O’Reilly. In his free time, Chris hosts the Web Services DevCon (November, 2002) and directs the Genghis source-available project. More information about Chris, and his various projects, is available at http://www.sellsbrothers.com.

Michael Weinhardt is a senior applications developer/architect for a superannuation fund. He has spent the last several years building n-tier Microsoft applications, most recently of the Internet variety using .NET. Besides involvement with RegexDesigner.NET, he is also contributing to Genghis. Michael is working to change his title from Applications Developer to Software Engineer, because he feels there is quite a difference. Thanks to the kindness of others, the attempt is made easier...and harder :-). If you'd like to say hi, you can get me here.


Using RegexDesigner.NET Overview

Using RegexDesigner.NET
Overview

Using RegexDesigner.NET

RegexDesigner.NET provides a variety of useful editing features and keyboard shortcuts to help you build, test and edit regular expressions, as well as manage your projects.


Editing

Using RegexDesigner.NET
Editing

Editing in RegexDesigner.NET

You can use a variety of commands to help editing in the Regular Expression, Replacement Text and Text To Match text boxes.

To select all text

  • In the desired text box, right-mouse click and select Select All.

To cut

  1. Select the desired text, and choose one of the following:
    • In the text box, right-mouse click and select Cut, or
    • Press CTRL-X.

To copy

  1. Select the desired text, and choose one of the following:
    • In the text box, right-mouse click and select Copy, or
    • Press CTRL-C.

To paste

  1. Select the desired text, and choose one of the following:
    • In the text box, right-mouse click and select Paste, or
    • Press CTRL-V.

To undo your last action since editing

  • Press CTRL-Z.

See Also

Keyboard Shortcuts


Keyboard Shortcuts

Using RegexDesigner.NET
Keyboard Shortcuts

Projects

To do this | Press this
Create a new project | Ctrl+N
Open an existing project | Ctrl+O
Save the current project | Ctrl+S
Exit RegexDesigner.NET | Alt+F4

Editing

To do this | Press this
Cut | Ctrl+X
Copy | Ctrl+C
Paste | Ctrl+V
Undo last action | Ctrl+Z

Regular Expressions

To do this | Press this
Match on a regular expression | Ctrl+M
Replace on a regular expression | Ctrl+R
Split on a regular expression | Ctrl+L
Generate code from a regular expression | Ctrl+G
Compile a regular expression to an assembly | Ctrl+Shift+B

See Also

Editing Commands


Managing Projects Overview

Managing Projects
Overview

Managing Projects

RegexDesigner.NET Project

Look here to find out about RegexDesigner.NET project files.

Using Projects

You can Create, Open and Save your project files in RegexDesigner.NET.


What is a Project?

Managing Projects
What is a Project?

RegexDesigner.NET Projects

RegexDesigner.NET stores project information in .REP files. Each .REP file contains the following information:

  • Regular expression
  • .NET Regular expression options
  • Text to match
  • Replace text
  • Compile to assembly FileName
  • Compile to assembly Namespace name
  • Compile to assembly Class name
  • Compile to assembly Class protection level

See Also

Create a New Project | Open an Existing Project | Save a Project


Create a New Project

Managing Projects
Create a New Project

To create a new project

  • On the File menu, click New, or
  • On the toolbar, click the New button, or
  • Press CTRL-N

See Also

What is a Project? | Open an Existing Project | Save a Project


Open an Existing Project

Managing Projects
Open an Existing Project

To open an existing project

  • On the File menu, click Open, or
  • On the toolbar, click the Open button, or
  • Press CTRL-O

See Also

What is a Project? | Create a New Project | Save a Project


Save a Project

Managing Projects
Save a Project

Save a new, unnamed project

  1. To save the current project, do one of the following:
    • On the File menu, click Save.
    • On the toolbar, click the Save button.
    • Press CTRL-S.
  2. If you want to save the project in a different folder, navigate to and open the folder.
  3. In the File name box, type a name for the project.
  4. Click Save.

Save an existing project

  1. To save the current project, do one of the following:
    • On the File menu, click Save.
    • On the toolbar, click the Save button.
    • Press CTRL-S.

Save a copy of a project

  1. Open the project you want to make a copy of.
  2. On the File menu, click Save As.
  3. If you want to save the project in a different folder, navigate to and open the folder.
  4. In the File name box, type a new name for the project.
  5. Click Save.

See Also

What is a Project? | Create a New Project | Open an Existing Project


Regular Expressions Overview

Regular Expressions
Overview

Regular Expressions

Regular Expression Operations

RegexDesigner.NET supports constructing and editing of Match, Replace and Split regular expressions. RegexDesigner.NET displays detailed Match Results to aid regular expression development.

Development Project Integration Features

On top of the standard regular expression operations, RegexDesigner.NET lets you generate C# and VB.NET native-code to use the .NET Framework's regular expression implementation, as well as providing the ability to compile your regular expressions into .NET assemblies.

See Also

MSDN - Regular Expressions


Match

Regular Expressions
Match

To perform a regular expression Match

  1. Select the appropriate regular expression options from the Regex menu.
  2. In the Regular Expression tab, enter or edit your regular expression.
  3. In the Text To Match box, enter or edit the text you would like to search for matches.
  4. Do one of the following:
    • On the Regex menu, click Match.
    • On the toolbar, click the Match button.
    • Press CTRL-M.
  5. Results of the regular expression Match operation are displayed in the Results box, including tooltips displaying matches and named groups.

See Also

Replace | Split | Match Results | Match Results Views


Replace

Regular Expressions
Replace

To perform a regular expression Replace

  1. Select the appropriate regular expression options from the Regex menu.
  2. In the Regular Expression tab, enter or edit your regular expression.
  3. In the Replacement String tab, enter or edit the text you would like to replace text matched by the regular expression.
  4. In the Text To Match box, enter or edit the text you would like to search for matches to replace.
  5. Do one of the following:
    • On the Regex menu, click Replace.
    • On the toolbar, click the Replace button.
    • Press CTRL-R.
  6. Results of the regular expression Replace operation are displayed in the Results box, including tooltips displaying replacements, original values and named groups.

See Also

Match | Split | Match Results | Match Results Views


Split

Regular Expressions
Split

To perform a regular expression Split

  1. Select the appropriate regular expression options from the Regex menu.
  2. In the Regular Expression tab, enter or edit your regular expression.
  3. In the Text To Match box, enter or edit the text you would like to search for matches to split on.
  4. Do one of the following:
    • On the Regex menu, click Split.
    • On the toolbar, click the Split button.
    • Press CTRL-L.
  5. Results of the regular expression Split operation are displayed in the Results box, including tooltips displaying replacements, original values and named groups.

See Also

Match | Replace | Match Results | Match Results Views


Match Results

Regular Expressions
Match Results

Displaying Match, Replace and Split Results

RegexDesigner.NET uses a variety of UI features to help you interpret you results and construct/correct your regular expressions.

Color-Coded Match Results

Match, Replace and Split operation results are color-coded to help you distinguish matched results from unmatched. You can also move the mouse over match results to see tooltips that provide more granular details on a specific match.

Match Tooltips

If you move the mouse over color-coded match results, RegexDesigner.NET pops up a match tooltip that details the following specific information regarding the selected match:

  • Match number
  • Original values (if a Replace or Split operation)
  • Numbered and named groups

Special Characters

Regular expressions match on alphanumeric and punctuation characters, as well as non-printing and zero-length characters. The following table shows how RegexDesigner.NET displays special characters in the Match Results.

Special Character | Displayed As
Space | @
Zero-Length | []
Split | |
Carriage Return | \r
Linefeed | \n
Formfeed | \f
Tab | \t
Vertical Tab | \v

See Also

Match | Replace | Split | Match Results Views


Match Results Views

Regular Expressions
Match Results Views

Viewing Results in RegexDesigner.NET

RegexDesigner.NET provides two options which control how Match Results can be viewed.

To view one or all Match, Replace or Split results

  • On the View menu, click Show Multiple Matches to toggle.

To show or hide zero-length matches

  • On the View menu, click Show Zero-Length Matches to toggle.

See Also

Match | Replace | Split | Match Results


Generating Code

Regular Expressions
Generating Code

Generating Regular Expression Code

RegexDesigner.NET provides a powerful code generation feature, which allows you to create code in either C# or VB.NET to create a Regex object, perform a Match, Replace or Split operation and then process the relevant results, including:

  • Checking for a Match
  • Returning the first Match
  • Finding all Matches
  • Finding all numbered and named groups
  • Returning the Replace results string
  • Finding all Split results

To generate regular expression code

  1. To open the Generate Code dialog, do one of the following:
    • On the Regex menu, click Generate Code...
    • On the toolbar, click the Generate Code button.
    • Press CTRL-G.
  2. The dialog will open, and by default will generate C# code for a Match operation.
  3. Use the operation and language buttons to generate the desired code.
  4. Click Copy to select the generated code into the clipboard, or use the mouse to select and copy specific sections of code.
  5. Click Close once you have finished.

See Also

Compiling To Assemblies


Compiling To Assemblies

Regular Expressions
Compiling To Assemblies

Compiling Regular Expressions To Assemblies

RegexDesigner.NET provides the ability for you to Compile a regular expression to a .NET assembly, and reference it from you application(s). This can be useful where you need to reuse a business-specific regular expression across one or more applications. Compiled assemblies are also a great way to encapsulate complex and/or large regular expressions.

To compile a regular expression to an assembly

  1. To open the Compile To Assembly dialog, do one of the following:
    • On the Regex menu, click Compile To Assembly...
    • On the toolbar, click the Compile To Assembly button.
    • Press CTRL-SHIFT-B.
  2. To enter the Assembly File Name, you can either:
    • Type the folder and file name directly into the Assembly File Name text box, or
    • Click the Browse button to navigate to a folder and enter a filename
  3. Enter the Namespace and Class names, and select a Protection level.
  4. Click OK to create the assembly.

See Also

Generating Code