I'm using regex (REreplaceNoCase()) to set the file path of the root of a site that I'm working on. Until now, it has worked great.
What I'm doing is using ExpandPath() to set an application variable in application.cfc so that no matter what folder under the webroot is being used, the variable will always have the same value, no matter if on DEV, Staging, or Production environment.
So, let's say one server in each environment: ServerA, ServerB, ServerC, respectfully.
The webroot on ServerA is C:\web\webdocs\myproject\
The webroot on ServerB is C:\web\webdocs\myproject\preview\
The webroot on ServerC is F:\hosting\www\public_html\myproject\docs\
I need a regex mask to point to the root on all three servers without hardcoding it, because, you know.. things are constantly changing, and you don't always know that paths will remain as is.