Для того, чтобы искать и с флагом /.../g и со скобочными группами, используется метод RegExp#exec: var str = 'Привет, мир!'; var reg = //g ...

  learn.javascript.ru

  javascript.info

In a string, I need to replace all occurences of [A], "A", 'A' and _A_ with [X], "X", 'X' and _X_. I tried this answer but it's giving a weird result (code below).

  stackoverflow.com

Ok the question is quite simple. I'm looking for a string like this one : … I have HTML code before and after the string above. Now i would like to replace the 0 by something like : !NEW_ID!

  stackoverflow.com

29 мар 2017 ... foreach (Match match in Regex.Matches(input, pattern ...... Index); int captureCtr = 0; foreach (Capture capture in groups[grpCtr].Captures) ...

  docs.microsoft.com

  flaviocopes.com

14 ноя 2017 ... str .replace( regexp | substr , newSubStr | function [, flags ]) ... аргумент flags не работает в ядре v8 (движок JavaScript в Chrome и NodeJs).

  developer.mozilla.org

s|$)/g; // Get an array containing the first capturing group for every match var matches ... быть решена очень элегантно с помощью mystring.replace() вместо этого (замена не ... FF/Gecko определяет RegExp как расширение функции.

  qaru.site

15 окт 2018 ... Конструктор RegExp создаёт объект регулярного выражения для сопоставления текста с шаблоном. ... JavaScript Demo: RegExp Constructor ..... Следующий скрипт использует метод replace() экземпляра строки String для .... g, function(m, group) { console.log("'group:" + group + "'"); }); // 'group:' ...

  developer.mozilla.org

I have to replace strong tag with b tag. To do this I have created a regex /<\s*\/?\s*(strong)\s*>/gi. I only want to replace capturing group (strong) only. But it replaces whole tag with be.

  stackoverflow.com

25 мар 2018 ... Шаблоны для заменыReplacement patterns. Чтобы использовать нумерованную группу записи, заключите группу в скобки в шаблоне ...

  docs.microsoft.com

  developer.mozilla.org

  www.dskims.com

I'd like to know how to replace a capture group with its uppercase in JavaScript. Here's a simplified version of what I've tried so far that's not working: … Would you explain what's wrong with this code?

  stackoverflow.com

jest.config.js const {defaults} = require('jest-config'); module.exports = { // . ... All modules used in your tests will have a replacement implementation, .... Additionally, you can substitute captured regex groups using numbered backreferences.

  jestjs.io

16 янв 2009 ... полная форма записи var expr = new RegExp(pattern [, flags]); .... str = "John Smith"; var newstr = str.replace(re, "$2, $1"); alert(newstr); // "Smith, John" ..... сказать, подзапроса просто не записывается в "capturing groups".

  javascript.ru

  code-examples.net

  exceptionshub.com

Как проверить адрес электронной почты в JavaScript? ... У меня есть эта строка: "Test abc test test abc test test test abc test test abc" Выполнение str = str .replace('abc', ''); похоже, удаляет только ... regex regex-group capturing-group.

  qaru.site

17 мар 2009 ... Named Capturing Group и Backreferences ... книгу Ben Forta "Teach Yourself Regular Expressions in 10 Minutes" (ISBN: 0-672-32566-7).

  habr.com

Page generated - 0.0277972221 (f765b307214c8135ee6e0aa34816a61e)