# Valid daml variable names

**URL:** <https://forum.canton.network/t/valid-daml-variable-names/802>\
**Category:** App Development\
**Created:** [July 7, 2020, 6:43pm UTC](https://forum.canton.network/t/valid-daml-variable-names/802 "2020-07-07T18:43:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dliakakos](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dliakakos/32/62_2.png) [@dliakakos](https://forum.canton.network/u/dliakakos)\
**Post date:** [July 7, 2020, 6:43pm UTC](https://forum.canton.network/t/valid-daml-variable-names/802/1 "2020-07-07T18:43:28Z")

</div>

I am trying to define a regex that will match a valid variable name in daml.  
For example `alice` is allowed whereas `Alice` is not.

I have this so far: `^[a-z][a-zA-Z0-9'_]*$`

Is it correct? Thanks

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [July 7, 2020, 6:46pm UTC](https://forum.canton.network/t/valid-daml-variable-names/802/2 "2020-07-07T18:46:40Z")

</div>

DAML follows the Haskell syntax for variable names which is described [here](https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4). The definition for `varId` is the correct one (ignoring symbolic infix operators). You are pretty close. Ignoring unicode characters, the correct regex is `^[a-z_][a-zA-Z0-9'_]*$`. Of course reserved keywords like `case` are excluded so it’s not quite accurate but probably good enough™.
