Результаты поиска по запросу "javascript regexp search replace example":

    1. JavaScript RegExp Object | Use String replace() With a Regular Expression

      • In JavaScript, regular expressions are often used with the two string methods: search() and replace().
      • For a complete reference, go to our Complete JavaScript RegExp Reference. The reference contains descriptions and examples of all RegExp properties and methods.

      www.w3schools.com

    2. Regular Expressions - JavaScript | MDN | Examples

      • In JavaScript, regular expressions are also objects. These patterns are used with the exec and test methods of RegExp, and with the match, replace, search, and split methods of
      • Using parenthesized substring matches. Advanced searching with flags. Examples. Changing the order in an input string.

      developer.mozilla.org

    3. Методы RegExp и String | При вызове со строкой замены replace всегда заменяет только первое совпадение.

      • Регулярные выражения в JavaScript являются объектами класса RegExp.
      • Ограничение метода search – он всегда ищет только первое совпадение. Нельзя заставить search искать дальше первого совпадения, такой синтаксис попросту не предусмотрен.

      learn.javascript.ru

    4. Regular Expressions in JavaScript — SitePoint | replace()

      • The following, for example, is a regular expression that searches for the text “JavaScript” (without the quotes)
      • Where regexp is the regular expression code, as described above.
      • See the Pen match() example by SitePoint (@SitePoint) on CodePen. replace().

      www.sitepoint.com

    5. regex search and replace example scripts - Python Testing

      • python search_replace.py example.txt. Now, I may or may not want to have the script modify the file in place. If not, then the second example above would just print the modified contents. I also may want to make a backup of example.txt first.

      pythontesting.net

    6. JavaScript RegExp Object - Using Regular Expressions with Client Side Scripting

      • To do a search and replace with regexes, use the string's replace() method: myString.replace(/replaceme/g, "replacement").
      • How to Use The JavaScript RegExp Object.
      • I have created an example web page showing JavaScript's regex support in action.

      www.regular-expressions.info

    7. RegExp - JavaScript | MDN | Examples

      • Properties. Methods. Examples. Using a regular expression to change data format.
      • RegExp.prototype.multiline. Whether or not to search in strings across multiple lines.
      • RegExp.prototype[@@replace](). Replaces matches in given string with new substring.

      developer.mozilla.org

    8. JavaScript String replace() Method | More Examples

      • ❮ JavaScript String Reference. Example. Return a string where "Microsoft" is replaced with "W3Schools"
      • Definition and Usage. The replace() method searches a string for a specified value
      • Read more about regular expressions in our RegExp Tutorial and our RegExp Object Reference.

      www.w3schools.com

    9. Methods of RegExp and String | For situations that require “smart” replacements, the second argument can be a function.

      • They are great for search-and-replace. str.match(reg) with “g” flag.
      • Here’s the example how subsequent regexp.exec calls return matches one by one
      • for any other reg.lastIndex the result is null. The regexp /javascript/iy can only be found if we set reg.lastIndex=7, because due to y flag the...

      javascript.info

    10. JavaScript test() Method | Example

      • ❮ JavaScript RegExp Object. Example. Search a string for the character "e": var str = "The best things in life are free"; var patt = new RegExp("e"); var res = patt.test(str)

      www.w3schools.com