What does the regular expression /_/g mean?

The regex matches the _ character.

The g means Global, and causes the replace call to replace all matches, not just the first one.

Leave a Comment