I need a help with Lua and regular expression to solve the following problem. I got many strings in the following format:
"|keynameN=value"
It may contain several spaces between the vertical bar (|) and the "keyname". Also, it may contain several spaces between the keyname and the equal symbol (=).
"|house10=true""|car11 = house""| name = car""| wow15 = cat"
I need to use string.gsub() function passing a regexp that dynamically replaces only the name of each key (house10, car11, name, wow15) with my owns, preserving its suffix numbers, and without changing the format of the strings (e.g. preserving the spaces). I've already tried many combinations but no success.