# PRE: foreach if-regex-match
string cisco_prefix

# This is what most people end up using foreach for,
# so we should probably test it works.
cisco_prefix := "cisco"

# Expanded regex
foreach Vendor-Specific.Cisco.AVPair {
	if ("%{Foreach-Variable-0}"  =~ /^%{cisco_prefix}=(.*)$/i) {
		reply += {
			Called-Station-Id = "%{1}"
		}
	}
}

# Compiled regex
foreach Vendor-Specific.Cisco.AVPair {
	if ("%{Foreach-Variable-0}"  =~ /^stupid=(.*)$/i) {
		reply += {
			Called-Station-Id = "%{1}"
		}
	}
}

