Regex group and set

Estimated reading time: 1 minute

group

group represent by () .

/(kamal)(\s)(the)(\s)(boss)(\.)/
// kamal the boss.

set

set represent by []

set a-z

/[a-z]/
//kamal is a developer of node.js . He is head of Idea's of Nishi IT Ltd.

set A-Z

/[A-Z]/
//kamal is a developer of node.js . He is head of Idea's of Nishi IT Ltd.

set package

/[a-zA-Z0-9]/
//kamal is a developer of node.js . He is head of Idea's of Nishi IT Ltd.  017512

set [kid]

/[kid]/
//kamal is a developer of node.js . He is head of Idea's of Nishi IT Ltd.

set not

/[^kid]/
//kamal is a developer of node.js . He is head of Idea's of Nishi IT Ltd.

limit bracket

/[0-9]{1,4}/
// 5.12765487565656554545454545454545454545455465

limit bracket 2

/[0-9]{2,4}/
/[\d]{2,4}/
// 5.12765487565656554545454545454545454545455465

[0-9] and [\d] same

regex, js