Answers for "how to use a pattern for replace function regular expressions"

8

regex replace /

// replaces all / in a String with _
str = str.replace(///g,'_');
Posted by: Guest on May-29-2020
0

Replace string using regex

line = re.sub(r"""
  (?x) # Use free-spacing mode.
  <    # Match a literal '<'
  /?   # Optionally match a '/'
  [   # Match a literal '['
  d+  # Match one or more digits
  >    # Match a literal '>'
  """, "", line)
Posted by: Guest on September-06-2021

Code answers related to "how to use a pattern for replace function regular expressions"

Code answers related to "Javascript"

Browse Popular Code Answers by Language