• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. Regular Expressions in ColdFusion > Useful Regular Expressions

17.5. Useful Regular Expressions

Now that you have a better idea of how regular expressions work, let's take a look at how you can actually use them in your own ColdFusion applications. Here are some regular expressions that perform common search-and-replace tasks:

  • Replace all characters in a string that aren't numbers, letters, or underscores with an underscore:

    <CFSET NewString = REReplaceNoCase(MyString, "[^0-9A-Z_]", "_", "All")>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint