The best is to take it to a local sailmaker and let them fix it.
If it's the inboard end of the pocket, and the elastic is not torn, you can make a temp repair with a 3 layers of sticky dacron tape - a 3" or 4" circle will do. It makes a smoother repair if you do it with the batten in the pocket , it doesn't matter if the tape has wrinkles, as long as the sail doesn't.
If the elastic is torn as well, a sailmaker is the answer. Typically it should cost between $15 and $30 to repair/replace the inboard end of the pocket
I just had two small rips, (one inch or so in length each) caused by a looped main around a dock cleat that resulted in a capsize, repaired in my sail for $65. But then again I'm sailing in Arizona. Not many sail lofts here. The price could be indicitive of supply and demand. Or just a good lesson to not have someone else tender your boat for you!