# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name.
fn_info_game_keyvalue_pairs(){
# sed is used to process the file.
# -n is an option that tells sed to suppress the default output behavior, meaning it will not automatically print every line of input.
# '/^[[:space:]]*\<'"${2}"'\>/ is a regular expression pattern enclosed within single quotes. It will be used to match lines of input.
# ^ indicates the beginning of a line.
# [[:space:]]* matches any whitespace characters (spaces or tabs) zero or more times.
# \< and \> are word boundaries, ensuring that the pattern matches whole words.
# "${2}" is an example of variable substitution, where the value of the second argument passed to the script will be inserted. In this case, it will be a regular expression pattern specified when executing the sed command.
# { s/.*= *"\?\([^"]*\)"\?/\1/p;q } is a block of commands enclosed within curly braces that will be executed when a line matches the pattern.
# s/.*= *"\?\([^"]*\)"\?/\1/ is a substitution command that replaces the entire line with the content within the quotes.
# .*= matches any characters (except newline) followed by an equal sign.
# * matches zero or more spaces after the equal sign.
# "\?\([^"]*\)"\? captures the content within the quotes and stores it in a group.
# \"? matches a double quote character zero or one time.
# \([^"]*\) captures any characters (except double quotes) zero or more times and stores them in a group.
# \"? matches a double quote character zero or one time.
# \1 refers to the first captured group from the pattern, which is the content within the quotes.
# p is a command that prints the modified pattern space (the result of the substitution).
# q is a command that quits the sed script, preventing further processing of input lines.
# -n option tells sed to suppress output by default.
# ^ This anchors the pattern to the beginning of the line.
# [^/]* This matches any character except a forward slash (/) zero or more times.
# ${2} matches the literal string "${2}".
# = " This matches the literal string " = ".
# \(.*\)" This is a capturing group that matches any sequence of characters until a closing double quote. It captures the desired value for later use.
# s//\1/ This performs a substitution with an empty search pattern (//) and replaces it with the captured value inside the capturing group (\1).
# p at the end of the s command tells sed to print the resulting line if there was a match.
# q at the end of the s command tells sed to quit after the first match.
# sed is the command itself, indicating that we want to use the sed utility.
# -n is an option that tells sed to suppress the default output behavior, meaning it will not automatically print every line of input.
# '/^[[:space:]]*${2}[[:space:]]*\"\?\(.*\)\?\"/' is a regular expression pattern enclosed within single quotes. It will be used to match lines of input.
# ^ indicates the beginning of a line.
# [[:space:]]* matches any whitespace characters (spaces or tabs) zero or more times.
# ${2} is an example of variable substitution, where the value of the second argument passed to the script will be inserted. In this case, it will be a regular expression pattern specified when executing the sed command.
# \"?\(.*\)\?\" is another regular expression pattern within double quotes.
# \"? matches a double quote character zero or one time.
# \(.*\) captures any characters (except newline) zero or more times and stores them in a group.
# \?\" matches a double quote character zero or one time.
# { s//\1/p;q } is a block of commands enclosed within curly braces that will be executed when a line matches the pattern.
# s//\1/ is a substitution command without specifying the search pattern. The empty search pattern indicates that it should use the previously matched pattern from the pattern space. The \1 is a reference to the first captured group from the pattern.
# p is a command that prints the modified pattern space (the result of the substitution).
# q is a command that quits the sed script, preventing further processing of input lines.