Linked Questions

1 vote
1 answer
1k views

I am having trouble finding any regex which actually matches what I need, despite how easy this request seemed when I started out. Hoping to get help here. An early mistake in our code is sending ...
DrHall's user avatar
  • 715
9 votes
5 answers
13k views

So, I have a function which has two params: string and match index to replace and i need to replace only match with that index. How can i do that? Example: replace('a_a_a_a_a', 1) Result: a__a_a_a
ruslan.savenok's user avatar
1 vote
3 answers
4k views

The following string represents a viewmodel property and in this case it has 3 different indices: PROGRAMA_FASES[1].PROGRAMA_FASE_REPLICAS[0].PROGRAMA_FASES.PROGRAMA_PREGUNTAS[2].Value I'm using ...
Javier's user avatar
  • 2,169
4 votes
2 answers
2k views

I am trying to split with this regex ({[^{}]*}) in javascript and I get different result btw IE7 and FF. The firefox result is the right one. <style> .box.round { border-radius: 10px; } <...
Codler's user avatar
  • 11.3k
0 votes
3 answers
2k views

I want to use regular expression to replace a string from the matching pattern string. Here is my string : "this is just a simple text. this is just a simple text. this is just a simple text. this ...
Sandeep Pal's user avatar
  • 2,195
2 votes
2 answers
681 views

Is it possible that I replace the $n element with a particular string? In my example the $1 element. For example, i want to replace the last element of a url "http://my.domain.com/sub/file.extension"...
Nano's user avatar
  • 1,397
1 vote
2 answers
356 views

Using a text editor, without writing JavaScript functions (e.g. can't use this great answer: Replacing the nth instance of a regex match in Javascript) How do I take something like this (a ...
Eran Medan's user avatar
  • 45.9k
0 votes
2 answers
308 views

I am trying to replace selected text with another text. Consider following is the line of text. Hello world.Good morning. Hello world. Good morning. Here if I select second morning text and I want ...
Sujit's user avatar
  • 658
5 votes
1 answer
314 views

We have a html div (first image) and array of strings (see second image) We have to assign the single index like safety[A4] and safety[A5] to the text of div. But currently it assign two footnote ...
Shital Kadam's user avatar
1 vote
3 answers
235 views

Basically I have a variable which contains a few paragraphs of text and I have a variable which I want to make bold within the paragraphs. (By wrapping <strong></strong> tags around it). ...
zuk1's user avatar
  • 18.5k
-2 votes
5 answers
82 views

I have a string like: some people may work for some thing new. I need to fetch the 2nd instance of the word 'some' using javascript reg exp. how can i get that? here is my try: var text = "some ...
3gwebtrain's user avatar
  • 15.5k
-3 votes
2 answers
47 views

I have a string like this: var str = "A A A A A"; how do I replace a specific A with something else? Eg: replace 3rd A to: var str = "A A 00 A A"; Of the 1st, 2nd, etc.. ?
JeffVader's user avatar
  • 694