replace 1 « Regular Expression « Javascript Data Type Q&A

Home
Javascript Data Type Q&A
1.Array
2.Clojure
3.date
4.decimal
5.function
6.global
7.loop
8.math
9.number
10.object
11.Regular Expression
12.scope
13.String
14.Var
15.variable
Javascript Data Type Q&A » Regular Expression » replace 1 

1. Replacing the nth instance of a regex match in Javascript    stackoverflow.com

I'm trying to write a regex function that will identify and replace a single instance of a match within a string without affecting the other instances. For example, I have ...

2. Javascript - how to replace a sub-string?    stackoverflow.com

This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript. Original string is 'original READ ONLY' I want to replace the 'READ ONLY' with 'READ ...

3. JavaScript Non-regex Replace    stackoverflow.com

Do any of the existing JavaScript frameworks have a non-regex replace() function, or has this already been posted on the web somewhere as a one-off function? For example I want to replace "@!#$123=%" ...

4. JavaScript Regexp Replace?    stackoverflow.com

I'm trying to come up with a regular expression which will wrap all occurences of JJDnnnnnnnnnnnnnnnn within a string with an anchor pointing to an url which contains the matched string ...

5. Javascript token replace/append    stackoverflow.com

Hi guys I have a string that looks something like the following 'test:1;hello:five;just:23'. With this string I need to be able to do the following.

....
var test = MergeTokens('test:1;hello:five;just:23', 'yes:23;test:567');
...
The end result ...

6. Using Regular Expressions with Javascript replace method    stackoverflow.com

Friends, I'm new to both Javascript and Regular Expressions and hope you can help! Within a Javascript function I need to check to see if a comma(,) appears 1 or more ...

7. How might I perform conditional replacement using JavaScript's RegExp?    stackoverflow.com

I am trying to wrap my head around using regular expressions and replace() with JavaScript, but have not yet been successful Suppose I have a string containing this:

<img alt="a picture of ..." ...

8. Javascript replace() with case-change    stackoverflow.com

Is there an easy way to change the case of a matched string with javascript? Example String : <li>something</li> Regex : /<([\w]+)[^>]*>.*?<\/\1>/ And what I'd like to do is replace the match $1 to ...

9. JavaScript replace/regex    stackoverflow.com

Given this function:

function Repeater(template) {

    var repeater = {

        markup: template,

        replace: function(pattern, value) ...

10. JavaScript Replace issues    stackoverflow.com

I have an array of objects that have 2 properties: Key and Value. I have a block of text with placeholders that correspond to the object Keys. I want ...

11. Javascript String.replace with dynamic regular expressions?    stackoverflow.com

I have the following code, which works, but I need to inject some different stuff into the regular expression object (regex2) at runtime. However, text.replace does not seem to like a ...

12. How to replace all occurences of a variable in a string using javascript?    stackoverflow.com

I'm trying to replace all the occurrences of a variable in a string using javascript. This is not working.:

var id = "__1";
var re = new RegExp('/' + id + '/g');
var newHtml ...

13. How do I replace an asterisk in Javascript using replace()?    stackoverflow.com

Using JQuery, I'm extracting the value from what is essentially a query box for some data in a MySQL database. Knowing that most users will use an '*' (asterisk) as a ...

14. Javascript replace doesn't work when it should    stackoverflow.com

var src = "http://blah.com/SOMETHING.jpg";
src.replace(/.*([A-Z])\.jpg$/g, "X");
at this point, shouldn't src be:
http://blah.com/SOMETHINX.jpg
If I use match() with the same regular expression, it says it matched. Regex Coach also shows a ...

15. Need Regexp for classname replace    stackoverflow.com

Hi I have following HTML code: Its look like

<html>
<head>
</head>
<style id="styletag">
.class3{
}
.sec2{
}
.this3{
}
</style>

<body>
<div class="class1 class2 class3">content</div>
<div class="sec1 sec2 sec3">content2</div>
<div class="this1 this2 this3">content2</div>
</body>
</html>
I am having the values class3, sec2 and this3 in array.
I want to ...

16. Javascript regex    stackoverflow.com

Currently I have a basic regex in javascript for replacing all whitespace in a string with a semi colon. Some of the characters within the string contain quotes. Ideally I would ...

17. Fast Javascript String Replacement    stackoverflow.com

This is for an autocomplete plugin that needs to accept data as an array of arrays and convert it using a format string (or regex). The format string could be any ...

18. JavaScript Regular Expressions - Forcing case when replacing    stackoverflow.com

Does the JavaScript regex standard support forcing case when doing a search/replace? I am generally aware of the \u etc. options for forcing the case of a capture group in the replacement ...

19. Use Match and then Replace in JavaScript Regex    stackoverflow.com

Consider:

    <% 
        content = ""+Request.Form("completehtml")+"";
        contentmatch = content;
      ...

20. replacing linebreaks in javascript doesn't work :(    stackoverflow.com

Hey there, I'm trying to replace a

<blockquote>...</blockquote>
with
>> ...
This is my Code:
var testhtml = 'sdkjhfbs <blockquote>skldfjsfkjghbs\n sdjkfhb ksdbhv isl\n kdjbhdfgkj bs</blockquote>kdjfgnkdfj';
alert(blockquoteConvert(testhtml));

function blockquoteConvert(html) {
    return '>>' + html.
 ...

21. Javascript String Replace    stackoverflow.com

I have a string of tags delimited by semicolons:

"red; yellow; blue; green; purple"
I would like to strip out all the tags that do not match a substring (case-insensitive.) For example, ...

22. JavaScript regex replace - but only part of matched string?    stackoverflow.com

I have the following replace function

myString.replace(/\s\w(?=\s)/,"$1\xA0");
The aim is to take single-letter words (e.g. prepositions) and add a non-breaking space after them, instead of standard space. However the above $1 variable doesn't work ...

23. question about javascript string's replace method    stackoverflow.com

I know that I can pass a string as the second parameter to the JavaScript string object's replace method. In this case I can use $` and $' to reference the ...

24. Why does a $ in the replacement string passed to the replace() function break some of the time?    stackoverflow.com

I have a variable that I'm using to build a JavaScript function call, and JavaScript's .replace() to surround the line of text with a span and onclick event. The .replace() ...

25. JavaScript String Replace with a tricky regular expression    stackoverflow.com

I'm trying to work out what regular expression I would need to change this string

html = '<img style="width: 311px; height: 376px;" alt="test" src="/img/1268749322.jpg" />';
to this
html = '<img width="311" height="376" alt="test" src="/img/1268749322.jpg" ...

26. Need to replace everything after the second match    stackoverflow.com

Ok so if I have this pattern:

ab&bc&cd&de&ef
And I need to replace all the ampersands except for the first one with commas so it ends up looking like this:
ab&bc,cd,de,ef
Its probably very simple ...

27. Replacing strings with regex in JavaScript    stackoverflow.com

A particular regular expression is bugging me right now. I simply want to replace the range=100 in a string like

var string = '...commonstringblabla<b>&range=100&</b>stringandsoon...';
with
...commonstringblabla<b>&range=400&</b>stringandsoon...
I successfully matched the "range=100"-part with
alert( ...

28. Multiple Regex on String    stackoverflow.com

How can I apply multiple regexs to a single string? For instance, a user inputs the following into a text area:

red bird
blue cat
black dog
and I want to replace each carriage return with ...

29. Token replacement in javascript    stackoverflow.com

What I need to implement is to find patterns in a string , store matches replace the matches with unique tokens so that later on the token could be replaced by ...

30. Regular expression replacing only if contained withing a regular expression match?    stackoverflow.com

I have the following:

[list]
[*] test
[*] test
[*] test
[/list]
and I would like to create a regular expression that turns that into:
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
I know regex enough to replace simple tags, but in this case I ...

31. Using innerHTML.repalce to replace text with img element    stackoverflow.com

I'm writing a script to add extra smileys to the Gmail chat.
Its working partially, i'm stuck with the innerHTML.replace method @line 33

If you see, the regex in the replace ...

32. JavaScript Replace - u0009 .... with .replace(/\u0009/g,'');    stackoverflow.com

I'd like to use Javascript to replace all instances of \u009 in a string This doesn't seem to be working: .replace(/\u0009/g,''); Do I need to escape something?

33. JavaScript Regular expressions, match and replace link    stackoverflow.com

 <html>
  <body>
       http://domainname.com/abc/xyz.zip
       http://domainname2.com/abc/xyz.zip 

 </body>
 </html>
I want replace with link and out put like
 <html>
  ...

34. Javascript Replace text in string    stackoverflow.com

I'm having some troubles getting regex to replace all occurances of a string within a string.

**What to replace:**
href="/newsroom

**Replace with this:**
href="http://intranet/newsroom
This isn't working:
str.replace(/href="/newsroom/g, 'href="http://intranet/newsroom"');
Any ideas?

EDIT

My code:
str = '<A href="/newsroom/some_image.jpg">photo</A>';
str = str.replace('/href="/newsroom/g', 'href="http://intranet/newsroom"');
document.write(str);
Thanks, Tegan ...

35. How to automatically insert predefined text into a string in positions definable by a regular expression    stackoverflow.com

I'd like to use javascript to search a string and automatically insert a closing tag before every occurrence of an opening tag. Here is the test code I've come up ...

36. RegularExpression String replace    stackoverflow.com

I have html code as a string variable like a = "<span> Spain will win ....... </span>" and I want to heightlight "spa" in the String. I have to use RegExp, How should I ...

37. JavaScript .replace only replaces first Match    stackoverflow.com

var textTitle = "this is a test"
var result = textTitle.replace(' ', '%20');
But the replace functions stops at the first instance of the " " and I get the Result : "this%20is ...

38. Javascript replace method, replace with "$1"    stackoverflow.com

I'm reading Sitepoints 2007 book "Simply Javascript" and I encountered some code I just can't understand. It's the following code:

Core.removeClass = function(target, theClass)
{
    var pattern = new RegExp("(^| )" ...

39. Regex to replace first occurence of match in javascript    stackoverflow.com

I have below test cases as input:

  1. [This is my test] [This is my test] My name is xyz. Want Expected output as :
    [This is my test] My name is xyz.
    . ...

40. replace string with javascript using regex    stackoverflow.com

Hi I have text inside "textarea" and I was trying to remove the text between: <textarea></textarea> using replace function with some regex. here is what I did so far:

x = '<TEXTAREA style="DISPLAY: ...

41. how to replace multiple occurrences of `  and
`
    stackoverflow.com

how to replace multiple occurrences of &nbsp; and <br> at start of the string with javascript regex?

42. Regex help: replacing all matches except the first one    stackoverflow.com

I have a malformed URL like this: http://www.abc.com/?abc&?as&?blah Now, I want to match (and eliminate) all "?" in the URL except the first one to make the URL clean. ...

43. Javascript Regex problem    stackoverflow.com

I have <li> elements in my document such as:

<li id="123" onMouseOver="foo();">Lorem Ipsum ...
I would like to remove the attributes and get the string <li>Lorem Ipsum .... In order to do that, ...

44. JavaScript: How to replace 0-9 with a-j    stackoverflow.com

Using JavaScript's replace and regex, how do I replace numbers 0-9 with the letters a-j ? example mapping: 0 = a, 1 = b, 2 = c, 3 = d, 4 = ...

45. Difficult Regex Javascript duplicates replace    stackoverflow.com

I am hoping that someone maybe able to help me. I need to create a regex that will remove all duplicates from a input file - I am creating a ftp.exe ...

46. how to replace all using regexp (javascript)    stackoverflow.com

var text = "&#39;Hello&#39;World&#39;&#39;&#39;";
how to replace all &#39; and Hello and World to '
result = "'''''''"

47. JavaScript regex: Not starting with    stackoverflow.com

I want to replace all the occurrences of a string that doesn't start with "<pre>" and doesn't end in "</pre>". So let's say I wanted to find new-line characters and replace them ...

48. Using $0 in Javascript's String.replace    stackoverflow.com

I'm highlighting instances of a search string within a set of text. I want to preserve the case of the original text while replacing a case-insensitive match of the query. Here's ...

49. Javascript regex replace - swap position    stackoverflow.com

I need a javascript regex replace function to turn

<font anything_possible><span anything_different_possible></span>
into
<span anything_different_possible></span><font anything_possible>
I tried many combinations but failed. Any help appreciated.

50. JavaScript String Replace with regular expression and function as arguments    stackoverflow.com

I seem to be getting conflicting advice in the books I read on this functionality. I'm wondering if someone could clarify. For example Nicholas Zakas states the function argument has a signature of ...

51. javascript fail - regexp bug    stackoverflow.com

Hei all I have this code

function prototype( str , id )
{
    var ret = str;

    ret = ret.replace( /ΓΈ/g, 'oe' );
    ret = ...

52. JavaScript String.replace()    stackoverflow.com

The following replacement

"index.html".replace('\.html$', '_fr.html');
returns "index.html", indicating that the first argument didn't match anything. However, if I remove the "$"
"index.html".replace('\.html', '_fr.html');
then the first argument matches and "index_fr.html" is returned. Returning to the first ...

53. Javascript regexp: replacing $1 with f($1)    stackoverflow.com

I have a regular expression, say /url.com\/([A-Za-z]+)\.html/, and I would like to replace it with new string $1: f($1), that is, with a constant string with two interpolations, the captured string ...

54. How can I replace {0} but not {{0}}?    stackoverflow.com

I want to replace all {0} on a string with x. It should not match {{0}}. How can I do it?

55. Multiple Regex replace    stackoverflow.com

I am boggled by regex's I think I'm dyslexic when it comes to these horrible bits of code.. anyway, there must be an easier way to do this- (ie. list a ...

56. JavaScript: "Dynamic" back reference RegExp replacement    stackoverflow.com

I want to make replacements like this:

var txt = "Some text containing $_variable1 and with $_variable2 inside of it as well.";
var rx = /(\$_[a-z]+)/g

var $_variable1 = "A CAT";
var $_variable2 = "A ...

57. javascript replace for constructs like {... {..}... }    stackoverflow.com

I want to write a regexp for balanced braces constructs like {...}, {... {..}...} and {...{..{..}...}..{..}...} where ... means any text, which has no '{' or '}' chars If I do this:

 ...

58. How can I replace .NET string-placeholders with actual values in javascript?    stackoverflow.com

I have a string (coming from ASP.NET) which contains one or more placeholders. In .NET I'm using the string.Format() method to replace the placeholders with actual values:

var str = "aaa {0} ...

59. Javascript Replace Regex    stackoverflow.com

Ok, I'm actually trying to replace text. Basically, I am needing to replace all instances of this: | with a blank string '' However, this isn't working: langName = langName.replace(/|/g, ''); Also, would be ...

60. Problem in regular expression    stackoverflow.com

I am trying to remove multiple spaces by using below codes,its removing &nbsp also, but its not working for character N B S P.....

replace(SPACE, " ").replace(/^[\s\t\n\&nbsp\;]+|[\s\t\n\&nbsp\;]+$/g, '');

61. JS: Regex in replace    stackoverflow.com

i need this in php to javascript.

echo preg_replace('/(\S)+\?/', '', 'http://example.com/?test=1');
THX BTW: I tried
alert('http://example.com/?test=1'.replace('/(\S)+\?/g', ''));
but no happens.

62. how can i replace two strings in javascript like this?    stackoverflow.com

i want to assign src attribute to alt attribute with removing extension .png and removing src attribute.

string1='<img src="a.png"> hi '
to :
string2='<img alt="a"> hi '
how to do this? what is code?

63. What does \\$& in "str.replace(specials, "\\$&")" mean?    stackoverflow.com

I am refering to code from Case insensitive string replacement in JavaScript?:

RegExp.escape = function(str) 
{
  var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); // .*+?|()[]{}\
  return str.replace(specials, "\\$&");
}
What does \\$& ...

64. Javascript: how to pass found string.replace value to function?    stackoverflow.com

When I have something like this:

var str = "0123";
var i = 0;
str.replace(/(\d)/g,function(s){i++;return s;}('$1'));
alert(i);
Why does "i" equal 1 and not 4? Also, is it possible to pass the real value of $1 ...

65. JavaScript RegExp that replaces _FOO_ with FOO    stackoverflow.com

I have this string inside a variable:

var s = 'I have _this_ string inside a variable'; 
and I need a regular epxression which would produce this result:
'I have <code>this</code> string ...

66. Javascript: String replace problem    stackoverflow.com

I've got a string which contains q="AWORD" and I want to replace q="AWORD" with q="THEWORD". However, I don't know what AWORD is.. is it possible to combine a string and a ...

67. javascript regex replace help!    stackoverflow.com

my string is like this

coder<coder@gmail.com>
i want coder@gmail.com back any help will be appreciated!

68. javascript - string replace    stackoverflow.com

Not sure why but i can't seem to replace a seemingly simple placeholder. My approach

var content = 'This is my multi line content with a few {PLACEHOLDER} and so on';
content.replace(/{PLACEHOLDER}/, 'something');
console.log(content); // ...

69. Javascript Regex Replace Text between Markers?    stackoverflow.com

I have a start and end marker in html, I would like to replace the html between these markers with some other html. The expression below doesnt seem to work...

var myRegExp ...

70. Cross-Browser Regular expression library for Javascript to replace using function    stackoverflow.com

Is there a library for replacing using functions as argument when I call this function

"foo[10]bar[20]baz".replacef(/\[([0-9]*)\]/g, function(a) {
    return '[' + (ParseInt(a)*10) + ']';
});
it should return
"foo[20]bar[30]baz";
and when I call ...

71. regular expression replace with prototype?    stackoverflow.com

I got some html formatted in the following way:

[Title|<a class="external" href="http://test.com">http://test.com</a>]
From these texts I'd like to create links using "Title" as the text and "http://test.com" as link. How can I best ...

72. How to know if JavaScript string.replace() did anything?    stackoverflow.com

The replace function returns the new string with the replaces, but if there weren't any words to replace, then the original string is returned. Is there a way to know whether ...

73. JavaScript RegExp: What am I replacing?    stackoverflow.com

I'm working on a JavaScript syntax highlighter, that I need for a project I'm starting later. I have an expression called keywords.

var keywords = /break|case|catch|default|delete|do|else|false|for|function|if|in|instanceof|new|null|prototype|return|switch|throw|this|true|try|typeof|var|while|with/g
I then run script.replace(keywords, "<keyword>" + /* I ...

74. Using a function defined in a variable    stackoverflow.com

I found this code on another question, but am not sure how to use it:

var text = document.getElementById("text").innerHTML;
    text = text.replace(/"z"/g, 
  ...

75. Replacing filename with a Regex in JavaScript    stackoverflow.com

I need to replace a button using a Regex in JavaScript and was wondering how to do this. I know how to grab the src of the button, but I need ...

76. Replace filename using JavaScript?    stackoverflow.com

Can someone show me how to do the following in JavaScript? I know how to grab the src of the image, I just want to be able to replace the filename ...

77. Regex replace all qoutes between apostrophe's    stackoverflow.com

I am working with javascript and classic asp, I am hoping someone can help me with this regex. I need to replace

" (quotes)
between apostrophe's with a regex. I were thinking ...

78. problem with regex replacement    stackoverflow.com

I am trying to highlight the word that has been passed in using regex & css. But something seems to have gone wrong. can anyone please help me? $1 doesn't seem ...

79. REGEX / replace only works once    stackoverflow.com

I'm using REGEX and js replace to dynamically populate a variable in a href. The following code works the first time it is used on the page, but if a different ...

80. javascript regex replace at the end of string    stackoverflow.com

I have following string:

text = '20 as a % of 50'
I need to replace it using a regular expression, the result should be:
'20 / 50 * 100'
How ...

81. Javascript regex replace    stackoverflow.com

I have a langauge dropdown, and a javascript function which changes the page to the corresponding language selected. I need help on my regex replace: For example, I would like this URL ...

82. javascript regex string replace works only once    stackoverflow.com

Greetings. I have a function which watches the content of "price" field and updates the string in "cart" field. In "cart" field, string between | characters gets replaced with whatever is typed ...

83. Javascript replace text after an underscore    stackoverflow.com

I am trying to replace some text after an underscore in a filename. Example filename: FileName_true.png. I need to change it to FileName_false.png. Basically, i have an image that i want to change ...

84. Javascript Replace adds several
's to beginning and end of string
    stackoverflow.com

I'm using Javascript to add <br /> in between every letter of text in a tag. Code is as follows:

$(this).html($(this).text().replace(/(.{1})/g, "$1<br />"));
It's adding several extra <br /> tags to the beginning ...

85. Javascript regexp replace all
's
    stackoverflow.com

I'm trying to replace any <br /> tags that appear AFTER a </h2> tag. This is what I have so far:

Text = Text.replace(new RegExp("</h2>(\<br \/\>.+)(.+?)", "g"), '</h2>$2');
It doesn't seem to ...

86. Javascript - string.replace() text spanning multiple lines?    stackoverflow.com

Let's say I have text (not html), that I'm pulling from a textarea. It looks like:

ALTER LOGIN [user1] DISABLE 

GO 

~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~ 

~~~~~~~~~~~~~ important stuff to keep ...

87. javascript - string replacement    stackoverflow.com

Given only the email address, I'm trying to remove the email, corresponding person's name and the following comma (if exist) from the string regardless where in the string the email appears.

var ...

88. Javascript .replace() with multiple calls, some with variables, some with plain text    stackoverflow.com

Code:

var csMasterPrefix = 'CS_',
    cpMasterPrefix = 'CP_',
    csContentPrefix = 'CSContent_',
    cpContentPrefix = 'CPContent_';

/* ... */

$this.attr("id")
    .replace(csMasterPrefix,'')
    ...

89. Javascript RegEx replacing "    stackoverflow.com

I'm trying to patch the Drupal Panels module to fix this nasty issue, which makes the AJAX errorhandler completely unreadable. The error handler has this:

// Replace all &lt; and ...

90. Simple Regex question    stackoverflow.com

I want to remove this from a url string http://.....?page=1 I know this doesn't work, but I was wondering how you would do this properly. document.URL.replace("?page=[0-9]", "") Thanks

91. how to replace ( /" or /') to ( " or ') from the string in javascript    stackoverflow.com

how to replace ( /" or /') to ( " or ') from the string in javascript. I am referring the content inside the braces. Could anyone give me regular expression ...

92. replace all occurrences in a string    stackoverflow.com

How can you replace all occurrences found in a string? If you want to replace all the newline characters (\n) in a string.. This will only replace the first occurrence of newline

str.replace(/\\n/, '<br ...

93. JavaScript Regex replace if more than n occurence    stackoverflow.com

I have a Regex which replaces all non-alphanumeric characters with a hyphen.

slugName = $(this).val().replace(/[^a-z0-9]/gi, '-');
This works as it should, however since this is generated from user input, I may end ...

94. JavaScript RegExp Replace    stackoverflow.com

Not sure where I am doing wrong. I have a string such as Test (123x) and I am trying to find the (123x) and replace it with nothing: Here is my ...

95. .replace() regex question    stackoverflow.com

I can have a string that looks like this as an example:

sometext<a title="Wink"><img src="http:\\www.seemstatic.com\images\transparent.png" class="emoWink"></a>somemore text<a title="Wink"><img src="http:\\www.seemstatic.com\images\transparent.png" class="emoWink"></a>endof text...
I have the following Javascript that matches the above string, and replaces ...

96. Preserving case / capitalization with JavaScript replace method    stackoverflow.com

I'm continuing work on a search term suggestion tool using Jquery UI. I am now working on displaying the results with the search term pattern in bold. I have ...

97. Help with replacing a text with regex    stackoverflow.com

I have the following text in a file called build.xml:

component.rollup=true
component.rollup.modules.buildfiles=io-base.xml, io-form.xml, io-xdr.xml
component.rollup_dir=/base
I want it to add one file in it so it will become:
component.rollup=true
component.rollup.modules.buildfiles=io-base.xml, io-form.xml, io-xdr.xml, io-extended.xml
component.rollup_dir=/base
How can I do that ...

98. Javascript .replace works in Firefox but not IE    stackoverflow.com

The following attempt to replace whitespaces with hyphens works in Firefox but not IE:

metatext = metatext.replace(/[\s]/g,"-");
Neither do the following alternative attempts work in IE:
metatext = metatext.replace(/[\s+]/g,"-");

metatext = metatext.replace(/[ ]/g,"-");
Insights appreciated.

99. Javascript regex replace not working ie    stackoverflow.com

I am doing some logic to a string and everything workes fine in Firefox. Found error in IE but confused to fix it.

var txt=[], regg=/<\/?[^>]+>/gi, ost=str.replace(regg,'').substr(0,l), g=j=0;
var match = null;
while(match = ...

100. Regex in .Replace() Javascript problems    stackoverflow.com

I have the follow I am trying to replace "'234324234234234236548723adf83287942'" Basically I am trying to use var specialId = otherSpecialId[0].trim().replace(/^[']*$/,''); To try and get "234324234234234236548723adf83287942" But I can't seem to crack it ? How do I remove ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.