cfRegeX


About cfRegex

cfRegex is a project to provide a complete set of regex functionality for CFML, with an aim to make regex a first-class feature which is easy for everyone to use.

This means adding...

(A bunch of other exciting things are also planned.)

There's more...

In addition to all these features, this project is about encouraging all programmers to use regex, to help them understand it and discover how to get the most out of it.

Which is why, in addition to a full set of documentation on how to use cfRegex and what all its functions do, there is also documentation explaining general regex concepts and features, aimed at helping all levels of regex user to learn and improve, plus a discussion list where you can receive precise and detailed explanations to your questions.

Status

Latest version is v0.1.003, released on 31st May 2012.

Recent changes are shown on the roadmap page, (where you will also find plans for future versions).

Documentation Online!

The documentation section is now available, at docs.cfregex.net or via the main menu above.

Download cfRegex

Select an engine to see download and setup instructions.


Only CFML engines listed here
are supported by cfRegex v0.1

Download cfRegex v0.1
for ColdFusion 9.0.1 and 10

Note: If there is demand, cfRegex v0.2 will have an automated installer for ColdFusion 9.0.1 and 10, however installation must currently be performed manually.

Tag and Object - Manual Setup

  1. Download the archive and extract to a temporary location.
  2. Locate your ColdFusion root directory, referred to as {coldfusion-root} below.
  3. Move Regex.cfc and regex.cfm to {coldfusion-root}/wwwroot/WEB-INF/cftags/
  4. Copy Regex.cfc to {coldfusion-root}/CustomTags/

You can now use the cfregex tag and create Regex objects.

Functions - Manual Setup

Unfortunately there is no way in CF to auto-include user-defined functions, so this must be done manually on each request. This is not ideal, but - unless there is a way I am unaware of, or if Adobe adds such functionality - there is no way to avoid it.

  1. Inside {coldfusion-root}/CustomTags create a cfregex-functions directory.
  2. Move all remaining .cfm files to {coldfusion-root}/CustomTags/cfregex-functions/
  3. Create a mapping /cfregex-functions to this directory.
  4. At the start of every request, do:
    <cfinclude template="/cfregex-functions/include-all.cfm" />

Now you can also use the functions!

Download cfRegex v0.1
for Open BlueDragon 2.0

Note: If there is demand, cfRegex v0.2 will have an automated installer for OpenBD, and might also be implemented as a plugin so it can be installed into the core, however at present installation must be performed manually, and the tag must be referenced as "cf_regex".

Tag and Object - Manual Setup

  1. Download the archive and extract to a temporary location.
  2. Locate your OpenBD WEB-INF directory (e.g. {openbd-root}/webapps/openbd/WEB-INF).
  3. Move Regex.cfc and regex.cfm to {openbd-root}/webapps/openbd/WEB-INF/CustomTags/

You can now use the cf_regex tag and create Regex objects.

Functions - Manual Setup

Unfortunately I have not yet created an OpenBD plugin, which will allow functions to be installed as core functions. In the meantime, it is necessary to include the functions manually on each request.

  1. Inside {openbd-root}/webapps/openbd/WEB-INF/CustomTags create a cfregex-functions directory.
  2. Move all remaining .cfm files to {openbd-root}/webapps/openbd/WEB-INF/CustomTags/cfregex-functions/
  3. Create a mapping /cfregex-functions to this directory.
  4. At the start of every request, do:
    <cfinclude template="/cfregex-functions/include-all.cfm" />

Now you can also use the functions!

Download cfRegex v0.1
for Railo 3.2.2 and above

Note: cfRegex v0.2 will be available as a Railo Extension, making it even easier to setup!

Manual Setup Instructions

  1. Download the archive and extract to a temporary location.
  2. Locate your {railo-server}/context/ directory (e.g. {railo-root}/lib/ext/railo-server/context). *
  3. Copy Regex.cfc to {railo-server}/context/components/ directory.
  4. Copy Regex.cfc to {railo-server}/context/library/tag/ directory.
  5. Copy Regex*.cfm to {railo-server}/context/library/function/ directory.
  6. Restart the Railo server.

You can now use the cfregex tag, create Regex objects, and use all the Regex~ functions as if they were built-in functions.

*For per-context installation (or, if you do not have a {railo-server}/context/components directory), in steps 3..5 above use the {railo-web} directory, that is {webroot}/WEB-INF/railo