News
Press
Buy Now
  • TextPression will be available to buy soon!

Downloads
  • The TextPression beta will be available to download from this area soon!
Support
Contact

 

 

 


 

Regular Expressions 

What are they?

They are a way of specifying a pattern of text. Whereas a typical application may enable you to enter a specific string to be matched, an application that supports Regular Expressions will enable you efficiently describe the range of valid combinations of substrings that may make up a matched string.

What are they good for?

A search for one or more email address's serves as a good example. The email address: "info@textpression.com" is a simple string, you could use the Find functionality within your web browser and locate this string simply by typing it in. But what if you wanted to locate all of the email addresses on the site? You could just enter the "textpression" domain part to get all of the TextPression Software addresses, but what about the addresses of any third party companies?

Clearly you need to describe in general terms what you are looking for, rather than simply searching for a string. For our email example this would be the sequence of partial matches below:

  1. Find any valid combination of numerals, letters and symbols that comprise the Name part of the email address.
  2. Find an '@' symbol.
  3. Find any valid combination of numerals, letters and symbols that comprise the Domain part of the email address.
  4. Find a period.
  5. Find the final combination of letters that comprise the Suffix part of the email address.

How do I go about writing a Regular Expression?

You can often access this functionality by choosing from the "Advanced" search and replace options on offer by many applications. The exact syntax for Regular Expressions varies slightly according to the application that supports them, however the example below is typical of the string required to locate a valid email address:

  • \b[A-Z0-9._%-]++@[A-Z0-9._%-]+\.[A-Z]{2,4}\b

What do they have to do with TextPression?

By now you've no doubt realised just how useful Regular Expressions can be; however they can be a bit daunting for the uninitiated (bare in mind that the example above is for a fairly simple task) and even seasoned pro's often run into trouble with them.

TextPression enables you to graphically define expressions which give you much of the power of Regular Expressions without the complexity. Its Simple To Use Drag and Drop Interface means that you can define expressions without needing to learn and remember any special syntax.

Where can I find out more about Regular Expressions?

For a good general overview visit:

 


Copyright ©2006 TextPression Software. Privacy Policy