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

reFindNoCase: multiple matches

New Here ,
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

I have a string, wich could have multple matches.
But if i search with refindnocase, i will only find 1 match.

Let's say i have a string that looks like this (in an XML file):
<setting key="header" value="hi [name], welcom to my [site]. " />

Now i already have the [name] and [site] variables.
But since i can't use #name# in the XML file, i need to replace them with the value.

I want to find both [name] and [site] in the string and replace them with the correct value.
But i can only find the first one.

How can i find both?
the regexp i use now is: <cfset regexp = "\[+[[:word:]]*\]" />

Maybe i need to do this with a <cfloop condition=""></cfloop>
Can someone help me with this?
TOPICS
Advanced techniques

Views

380

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
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

LATEST
ReFind ( ) locates the first occurrence of the pattern. To find subsequent occurrences, you will need a loop similar to the following:

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