Regular expression nothing but one type of an object, that describes a pattern of character.
Mostly regular expressions are using for pattern matching performance and “search-and-replace” functions on the text.
/finalhints/i – show as a regular expression
finalhints – seems as a pattern which use for search
i – seem as a modifier, that will be in case-sensitive.
Regular Expression seems to be like : /pattern/modifiers;
Regular Expression – Using String Methods
The search() regular expression string method use for searching matches and return the position of matches.
The replace() regular expression string method use for replacing the pattern.
Regular expressions can make your search more powerful.
Regular Expression Modifiers
i – perform as a case-sensitive
g – perform as a global match.(It will not stop after matching first match)
m – perform as a multiple matching.
Those sites also explain your regular expression by debugging your regular expression and explain which sub expression accept which type of character sequence.
Happy coding; 😉