Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-05-03 04:08
Updated·2022-05-03 04:19
Flavor·PCRE2 (PHP)

/
(\w*)\s(\w*)
/
gm
Open regex in editor

Description

What is snake case?

Snake case is a naming convention in which a developer replaces spaces between words with an underscore.

Snake case examples

Here are three simple examples of code in the snake case naming convention:

  • increase_count_by_one
  • materials_procurement
  • material_warehousing

regular expression

  1. match: /(\w+)\s(\w+)/
  2. replace: \L$1_\$2
Submitted by Moonshadow2333