• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

regex variables in rereplace

Guest
Oct 24, 2007 Oct 24, 2007

Copy link to clipboard

Copied

Is it possible to use regex variables with rereplace? For instance if I wanted to put brackets around the area code in a phone number, I'd like to do the below code, but it doesnt work, just sees the variable as a string

TOPICS
Advanced techniques

Views

382

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 24, 2007 Oct 24, 2007
I believe you can back-reference matched substrings with the backslash character (instead of the dollar sign).

You'll probably find this article helpful:
http://www.petefreitag.com/item/517.cfm

Votes

Translate

Translate
Engaged ,
Oct 24, 2007 Oct 24, 2007

Copy link to clipboard

Copied

I believe you can back-reference matched substrings with the backslash character (instead of the dollar sign).

You'll probably find this article helpful:
http://www.petefreitag.com/item/517.cfm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 24, 2007 Oct 24, 2007

Copy link to clipboard

Copied

awesome, thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 24, 2007 Oct 24, 2007

Copy link to clipboard

Copied

LATEST
> You'll probably find this article helpful:
> http://www.petefreitag.com/item/517.cfm

The official docs are more comprehensive (and a good place to START when
one has a query about CF):

http://livedocs.adobe.com/coldfusion/8/htmldocs/regexp_01.html#1100400

Livedocs are pretty good, these days.
--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation