Using string.split() to split spaces but ignore ones included between ""

I’m trying to split a string using spaces but ignoring spaces inside “”, here are some examples
( char me “avatar 23” ) → ( “char”, “me”, “avatar 23”) instead of (“char”, “me”, “avatar”, “23”)
How would I do this?

Use string:find to find a space or a quotation, then add/merge to an array them depending if the character is either a space or a quotation. I don’t think string.split supports this.

I found a way to do it by splitting string by " first and converting special spaces to other special characters then replacing them later after splitting using spaces