Hello.
Say there are strings like these.
:key args
, .key args
I wanted to know if it is possible to use string.match ONCE and nothing else to produce an effect such that it only matches the key
if the first character is in the set [%p:/]
and return me the characters after it but before the space i.e. .test args
returns test
but test arg
, a/test arg
return nil
.
I tried patterns like: ^[%p/:]%w+
and the likes using anchors but to no avail.