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

Regular expression syntax

Explorer ,
Jun 22, 2012 Jun 22, 2012
TOPICS
Documentation
1.5K
Translate
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
Community Beginner ,
Jun 22, 2012 Jun 22, 2012

until the empty string before “o” is matched should be until the empty string after “o” is matched.

For (?m), reFind("(?m)^two", "one#chr(10)#two") should return 5 instead of 4 because chr(10) counts.

Escape Sequence \\x should be \xdd. (d can have a hex value from 0 to f.)

Example of \x

<cfoutput>#reFind("\x43", "Adobe ColdFusion 10")#</cfoutput> returns 7.

<cfoutput>#reFind("\x46", "Adobe ColdFusion 10")#</cfoutput> returns 11.

Translate
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
Participant ,
Feb 03, 2013 Feb 03, 2013

This is incorrect: "To include a hyphen in the brackets of a character set as a literal character, you cannot escape it as you can other special characters because ColdFusion always interprets a hyphen as a range indicator."

You CAN escape the hyphen in a character class.

This can be demonstrated with:

Were the hyphen acting as a range, there would be five items in the array but since it is literal there are only the three.

Translate
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
Participant ,
Feb 03, 2013 Feb 03, 2013
LATEST

FFS! Useless comment system:

cfdump var=#rematch('[a\-c]','abc-123_')#

Translate
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