Search Results

Search found 7529 results on 302 pages for 'replace'.

Page 17/302 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Question about the String.replaceAll() and String.replaceFirst() method.

    - by Java Doe
    I need to do a simple string replace operation on a segment of string. I ran into the following issue and hope to get some advice. In the original string I got, I can replace the string such as to something else. BUT, in the same original string, if I want to replace a much long string such as the following, it won’t work. Nothing gets replaced after the call. <div class="more"><a href="http://SERVER_name/profiles/atom/mv/theboard/entries/related.do?email=xyz.com&ps=20&since=1273518953218&sinceEntryId=abc-def-123-456">More...</a></div> I tried these two methods: originalString.replaceFirst(moreTag, newContent); originalString.replaceAll(moreTag, newContent); Thanks in advance.

    Read the article

  • Removing certain characters in all rows that match a regex?

    - by user001
    I'd like to change {foo, {bar}, foobar} to {foo, bar, foobar} in all rows that match '{.*{'. I.e. remove all curly braces { and } except the outer most pair. So doing mysql -h $H -u $U -p$P $DB -B -e "SELECT id FROM t WHERE col REGEXP '{.*{'" > bad.txt selects all the rows that will need this substitution. How do I make this substitution very quickly? EDIT: Could I do it by update table set column = REPLACE(column,'{',''); Then restore the out most pair update table set column = REPLACE(column,'^','{'); update table set column = REPLACE(column,'$','}');

    Read the article

  • using sed to replace two patterns within a larger pattern

    - by Hair of the Dog
    Using sed how could I replace two patterns within a larger pattern on a single line? Given a single line of text I want to find a pattern (Let's call this the outer pattern) and then within that outer pattern replace two inner patterns. Here's a one line example of the input text: Z:\source\private\main\developer\foo\setenv.sh(25): export 'FONTCONFIG_PATH'="$WINE_SHARED_SUPPORT/X11/etc/fonts" In the example above the outer pattern is "/^.*([[:digit:]]+):/" which should equal "Z:\source\private\main\developer\foo\setenv.sh(25):" The two inner patterns are "/^[A-Za-z]:/" and "/\/". Another way to phrase my question is: Using sed I know how to perform replacements of a pattern using the "s" command, but how do I limit the range of "s" command so it only works on the portion of the input string up to the "(25):"? The ultimate result I am trying to get is the line of text is transformed into this: /enlistments/source/private/main/developer/foo/setenv.sh(25): export 'FONTCONFIG_PATH'="$WINE_SHARED_SUPPORT/X11/etc/fonts"

    Read the article

  • In String.replace("\c","") what ASCII value is ""?

    - by Tom
    Hi, im just writing my own replace method for any weird characters and i used the ASCI value 0, null to replace unwanted characters, i was hoping for them to be 'deleted', but this doesnt work. A gap just appears in the string. What exactly does String.Replace() do when removing a character for ""? Does it shift them all down and then 'delete' the final character or something?

    Read the article

  • Multiline Regular Expression search and replace!

    - by Scott
    I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like: search oldlog\(.*\n\s+([\r\n.]*)\);replace newlog\(\1\) Any ideas?

    Read the article

  • Search Replace extended in a html file

    - by Fake4d
    i have a little question. I have a big html file and want to replace lots of things inside a lot of times. The only problem i cant solve is a replace with a variable. Example: <image src="start_files\0002.jpg" style="width:216pt; height:162"> should be transformed in <a href="start_files\0002.jpg" target="_blank"><image src="start_files\0002.jpg" style="width:216pt; height:162"></a> do you have an idea how to do it? I have a windows system with Notepad2 and Notepad++ and i could install a new tool if needed. (like Windows SED). The best solution would be a batch solution where i can add other transformations. Hope you have got good ideas! Thanks forward, Fake4d

    Read the article

  • Replace a method call

    - by deV
    Hi, I want to achieve below task: 1. I need to search Html.Resource("key") in my application and replace it with GetResource("key",object) 2. The GetResource method has two parameters: the first parameter should be the same as the original method,"key" in this case, and I need to pass in the second parameter which is variable. 3. I need to replace only when the Html.Resource("key") occurs inside certain tags like td and div else I need not replace it. Thanks in advance

    Read the article

  • XML Node replacement in Actionscript 3

    - by Andreas
    Hi, A couple of days ago I asked a question about how to replace and edit values in an xml file with c#. The question got a great answer. Now I wonder how to do this in Actionscript and if there is an as simple way as in c#. The question can be found here: http://stackoverflow.com/questions/2856459/advanced-replace-in-c Thanks

    Read the article

  • Replacing characters with specified one

    - by mahesh
    Hello All, I have a string as follows - MFMFMF now i want to change this string to FMFMFM how to do this , help needed pls i had tried select replace(replace('mfmfmf','M','F'),'F','M') this gives me result - MMMMMM which i donot what i want the output to be FMFMFM Need your help D.Mahesh

    Read the article

  • preg_replace not working for charachter \

    - by krike
    I'm trying to replace \' with ' but it won't work This is the text I want to replace from Using Twitter\'s @Anywhere Service in 6 Steps and this is the code $tutorial = "Using Twitter\'s @Anywhere Service in 6 Steps "; echo $tutorial."<br /><br />"; $tut_title = preg_replace("/\\'/", "'", $tutorial); echo $tut_title;

    Read the article

  • Multiple Regex on String

    - by George
    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 a comma and each space with an underscore so the final string reads as red_bird,blue_cat,black_dog. I've tried variations in syntax along the lines of the following so far: function formatTextArea() { var textString = document.getElementById('userinput').value; var formatText = textString.replace( new RegExp( "\\n", "g" ),",", new RegExp( "\\s", "g"),"_"); alert(formatText); }

    Read the article

  • Remove %20 from URL using jquery

    - by Pankaj
    hello all When i am trying to get query string value from URL using JQuery, It replace space to %20 for each 1 space.If there are 3space then my query string value contain %20 3times. i want to replace these %20 back with space using Jquery, so that i can use these query string value. How can i do this.

    Read the article

  • Why can't I use accented characters next to a word boundary?

    - by Rexxars
    I'm trying to make a dynamic regex that matches a persons name. It works without problems on most names, until I ran into accented characters at the end of the name. Example: Some Fancy Namé The regex I've used so far is: /\b(Fancy Namé|Namé)\b/i Used like this: "Goal: Some Fancy Namé. Awesome.".replace(/\b(Fancy Namé|Namé)\b/i, '<a href="#">$1</a>'); This simply won't match. If I replace the é with a e, it matches just fine. If I try to match a name such as "Some Fancy Naméa", it works just fine. If I remove the word last word boundary anchor, it works just fine. Why doesn't the word boundary flag work here? Any suggestions on how I would get around this problem? I have concidered using something like this, but I'm not sure what the performance penalties would be like: "Some fancy namé. Allow me to ellaborate.".replace(/([\s.,!?])(fancy namé|namé)([\s.,!?]|$)/g, '$1<a href="#">$2</a>$3') Suggestions? Ideas?

    Read the article

  • Replace single file on tomcat-deployed war

    - by xain
    Hi, I'd like to know how to configure tomcat 6 in order to be able to replace a file from a war - for instance an image or a jsp - so I don't need to restart the server to keep it updated. I assume I'll have to deploy it as a directory - not just copying the war file to webapp ? Thanks.

    Read the article

  • Replace sound in another YouTube video

    - by Tom
    I have received permission from someone to translate the audio in their movies. The problem I am facing is that the video quality is quite poor and the author does not have the original videos any more. How can I replace the audio in the YouTube videos without further degrading the quality of the videos? Thanks, Tom

    Read the article

  • Replace clock battery on Dell Inspiron 8200?

    - by jacobsee
    I have an old Dell Inspiron 8200 laptop. Still mostly works, but the clock battery has died so everytime I power it on I need to go into the BIOS and set the proper clock time. From what I've been able to tell, replacing this battery is non-trivial, but I haven't found a clear answer. How do I replace the clock battery? And how do I buy a replacement?

    Read the article

  • searching for replace broken laptop screen

    - by eran
    hey, i have a laptop with 16'' wide screen, but the screen is broken and i want to buy only the screen and replace it.. my laptop is: HP Pavilion dv6-1050us what i know about the screen is that it's model number 512357-001 "16inch widescreen BrightView BV display panel IMR, with web camera and microphone". I did find some screen which seems to be the one but i'm not sure and dont want to spend money for the wrong screen, can any one help please? thanks, eran

    Read the article

  • Notepad++ Search & Replace with Regular Expressions

    - by Jeremy
    I know its simple, but I can't get it to work... I have a strings like {span style="display:none"}123{/span} and {span style="display:none"}456{/span} and {span style="display:none"}789{/span} in a file. I want to remove all of these string. So, I thought a simple regular expression replace in NotePad++ should be like "{span style="display:none"}[(.)]{/span}" - but, this is not working. Thank for your help!

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >