Hello! Thanks for the tip!
I modified your code. What you suggested didn’t work because the ^ character on RegExp means the first few characters. To catch the last characters and only the file extension, i made this below and it worked!
/^((javascript:)|(#))|(\w*((\.jpeg)|(\.jpg))\b)/i
Of course, if you have a better suggestion, let me know.
Again, thanks for the great support!