Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Group inside group

Tags:

regex

/(test|test1|is(cold|warm|large|small))/

iscold / iswarm / islarge / issmall are two different groups since "is" is from group1 and everything behind it is from group 2. How can I make it into one group so iscold|iswarm|islarge|issmall should be one group, without having to type "is" everytime infront of it.

like image 901
user3639768 Avatar asked May 15 '14 07:05

user3639768


People also ask

What is a nested group?

A nested group is defined as a parent group entry, which has members that are with group entries. A nested group is created by extending one of the structural group object classes by adding the ibm-nestedGroup auxiliary object class.

How do I create a nested group?

Navigate to the group that you want to nest inside another group. Right click on the group and click Properties. In the pop-up window, click the Member Of tab. Click Add to search for the group you want this group to reside in.

What is a nested ad group?

Group nesting in Active Directory is the process of planting one group inside another group. Active Directory Nested groups inherit all the permissions and privileges of the group that they are planted in.

Can Google Groups have sub groups?

Sometimes it's helpful to add one group to another. For example, if you have a group for each team that's part of a larger department, you can save the time it takes to individually add each member to a larger department group. Larger groups are called parent groups. Added groups are nested, child, or subgroups.


2 Answers

Technically, they are already in the same group (number 1). You just match the cold/warm... part in a second group too, which apparently you don't care about.

If you want to avoid this useless capture, you can use a non capturing group (?:...);

/(test|test1|is(?:cold|warm|large|small))/
like image 114
Robin Avatar answered Oct 17 '22 07:10

Robin


Use non capturing groups for the sub parts.

/(test|test1|is(?:cold|warm|large|small))/
like image 44
mpcabd Avatar answered Oct 17 '22 07:10

mpcabd