some very primitive regex parsing