Maybe this helps:
Because we do not have an alphabet yet we can look up the position, create one.
This is a range converted to an array so you don't need to specify it yourself.
alphabet = ("A".."Z").to_a
Then we try to get the integer/position out of the string:
string_to_match = "[1,5]"
/(\d+)\]$/.match(string_to_match)
Maybe the regexp can be improved, however for this example it is working.
The first reference in the MatchData is holding the second integer in your "string_to_match".
Or you can get it via "$1".
Do not forget to convert it to an integer.
position_in_alphabet = $1.to_i
Also we need to remember that the index of arrays starts at 0 and not 1
position_in_alphabet -= 1
Finally, we can take a look which char we really get
char = alphabet[position_in_alphabet]
Example:
alphabet = ("A".."Z").to_a #=> ["A", "B", "C", ..*snip*.. "Y", "Z"]
string_to_match = "[1,5]" #=> "[1,5]"
/(\d+)\]$/.match(string_to_match) #=> #<MatchData "5]" 1:"5">
position_in_alphabet = $1.to_i #=> 5
position_in_alphabet -= 1 #=> 4
char = alphabet[position_in_alphabet] #=> "E"
Greetings~