I am using awk and want to do vlookup kind of thing for a group pattern which matches the ids of the master list

`master.txt`

```
1.1.1: name00
1.1.2: name01
1.1.3: name02
1.1.4: name03
1.1.5: name04
1.2.2: name05
1.2.3: name06
1.2.4: name07
1.2.5: name08
1.2.6: name09
1.3.13: name10
1.3.14: name11
1.3.15: name12
1.3.16: name13
1.3.17: name14

```

`group.txt`

```
1.1: groupvalue0
1.2: groupvalue1
1.3: groupvalue2
1.1: groupvalue10
1.3: groupvalue12

```

each group can have multiple values

Corresponding master data for group `1.1`:
here `(^1.1.)` matches the below (matching from beginning only)

```
1.1.1: name00
1.1.2: name01
1.1.3: name02
1.1.4: name03
1.1.5: name04

```

similarly for `1.2`
here `(^1.2.)` matches the below (matching from beginning only)

```
1.2.2: name05
1.2.3: name06
1.2.4: name07
1.2.5: name08
1.2.6: name09

```

Based on the matching i want the result as

```
name00: groupvalue0  # 1.1.1 just shown for reference
name01: groupvalue0  # 1.1.2 just shown for reference
name02: groupvalue0  # 1.1.3 just shown for reference
name03: groupvalue0  # 1.1.4 just shown for reference
name04: groupvalue0  # 1.1.5 just shown for reference
name05: groupvalue1  # 1.2.2 just shown for reference
name06: groupvalue1  # 1.2.3 just shown for reference
name07: groupvalue1  # 1.2.4 just shown for reference
name08: groupvalue1  # 1.2.5 just shown for reference
name09: groupvalue1  # 1.2.6 just shown for reference
name10: groupvalue2  # 1.3.13 just shown for reference
name11: groupvalue2  # 1.3.14 just shown for reference
name12: groupvalue2  # 1.3.15 just shown for reference
name13: groupvalue2  # 1.3.16 just shown for reference
name14: groupvalue2  # 1.3.17 just shown for reference
name00: groupvalue10  # 1.1.1 just shown for reference
name01: groupvalue10  # 1.1.2 just shown for reference
name02: groupvalue10  # 1.1.3 just shown for reference
name03: groupvalue10  # 1.1.4 just shown for reference
name04: groupvalue10  # 1.1.5 just shown for reference
name10: groupvalue12  # 1.3.13 just shown for reference
name11: groupvalue12  # 1.3.14 just shown for reference
name12: groupvalue12  # 1.3.15 just shown for reference
name13: groupvalue12  # 1.3.16 just shown for reference
name14: groupvalue12  # 1.3.17 just shown for reference

```

I am trying to use the below awk code. but how to use pattern in arrays.

```
BEGIN{
    FS=": "
    #print(var)
}
{ 
  if(NR==FNR)         # process first file only
  {                    
    a[$1]=$2;           # hash to a array {id is key, name} value
    next;               # process next record without executing following code
  } else
  {                    # process second file
    pattern= "^"$1"\..*" # eg: ^1\.1\..*
    # can i use pattern in array
    print a[pattern]":",$2  # output name (the value of) from array a and property
  }

} master.txt group.txt

```