\b and \s don't work if the substring to be matched comes at the beginning of the string.
If you're going to contradict, please test first. You would have found yourself wrong. The beginning and the end of the string count as whitespace for \b. This is documented and observable:
$_ = 'alpha="first" beta="second" gamma="third"';
for my $id (qw( alpha beta gamma )) {
my ($val) = /\b$id=("[^"]*"|\w+)/
or next;
print("$id: $val\n");
}
alpha: "first"
beta: "second"
gamma: "third"
Or
$_ = 'alpha="first" beta="second" gamma="third"';
while (/(\w+)=("[^"]*"|\w+)/g) {
print("$1: $2\n");
}
alpha: "first"
beta: "second"
gamma: "third"