What is the defference between /gi and /ig in regular expression?

i solved a challenge with /ig and it said that i was wrong and when i looked at the solution, it was solved with /gi