Painless scripted field with regex syntax

Instead of accessing doc['message.keyword'].value, does it work with doc['message'].value?