Home > Back-end >  Regex to force lowered one word snack case
Regex to force lowered one word snack case

Time:06-12

I am trying to write a Dart CLI app. I want user to enter only lowered one word snack case like my_new_app_name. What is the regex of this?

CodePudding user response:

Here is the solution:

final rgxp = RegExp(r'^[a-z_] $');
rgxp.hasMatch('my_new_app_name');
  • Related