Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » replace
Showing page 1 of 2 (15 total posts)
  • Replacing text with matched text from same string

    Hello, I need help on matching and replacing text with different matched text from same string. My goal is to be able to batch process a large set of text files that each have similar patterns and replacement criteria. Below is an example of a typical case. In the example below, BOLD text replaces strikeout text: TITLE: Beautiful Losers - ...
    Posted to Construction Advice (Forum) by dhl on August 15, 2008
  • Replacing Missing Values in comma delimited file - Can this be done in one Regexp?

    I'm processing a comma delimited string and need to *ALL* replace missing values with '0's. Leading and/or trailing ','s denote missing values. For example:  The string ",,2,3,,,4," becomes "0,0,2,3,0,0,4,0"  Note that there are missing values at BOTH the beginning AND the end of the input ...
    Posted to Construction Advice (Forum) by SlowLearner on July 23, 2008
  • VBScript RexExp Replace a textstring only if not within tags <></>, possible?

    Hi, i got a dillema... for a company i need to make every occurence of it's company name to be in red and bold font. i have writen a simple function that i can call and filter all text database records Function companyName(inputText)  If inputText<>"" Then   companyName= ...
    Posted to Construction Advice (Forum) by RvdH on June 28, 2008
  • Find/Replace but ignore HTML tags

    Hi, I've got a javascript/regex scenario I was hoping to find a solution to.  Here’s the situation  We have been given the string "The quick brown fox jumped over the lazy sleeping dog." We want to replace it with "The large yellow tiger jumped over the lazy sleeping cat".  Normally this would ...
    Posted to Construction Advice (Forum) by beng on May 25, 2008
  • Convert BBCode, [color] tags, to HTML

    Greetings.  I have some problems using a Regex replace for converting the following BBCode: string bbCode = " [ color=red]Red[/color]"; Regex regExp = new Regex(@"\[ color=([^\]]+)\]([^\]]+)\[\/color\]"); string htmlCode = regExp.Replace(bbCode, "<span style=\'color: $1\'>$2</span>'); Essentially, ...
    Posted to Construction Advice (Forum) by Bassiq on April 7, 2008
  • VB.NET RegEx.Replace replacing the matched characters + 1

    I have the follwing code in VB.NET: Dim strPhone As String = oRow("phone").ToString.ToLower  ' data is like 123-555-0000X81455  If Regex.IsMatch(strPhone.ToLower, "ext.|ext|ex.|ex|x.|x") Then  strPhone = Regex.Replace(strPhone.ToLower, "ext.|ext|ex.|ex|x.|x", "A") End IfIt ...
    Posted to Construction Advice (Forum) by unclebiguns on March 6, 2008
  • Back Reference Overwrites Changes

    I ran into an interesting situation where back references overwrite previous changes in a regular expression. I needed a regular expression that updated a pattern but also checked for something that comes before the pattern.  It should leave everything before the pattern as it was before the updates.  There can be multiple matches of ...
    Posted to Construction Advice (Forum) by AProgrammer on November 20, 2007
  • Can't figure it out...

    Hi there, I hope someone can help, cause I'm lost... First of all I am working with C# and I have a (legacy) Regex I need to adjust. Actually I am using Regex.Replace to match an expression in a string and Replace it. My current Regex.Replace looks like this: query = Regex.Replace(query, ...
    Posted to Construction Advice (Forum) by mischa78 on June 28, 2007
  • Find and replace

    Hello, I am able to find what I want by building my regex. Now I need to replace what matches with something related to it, I want to remove the quotation marks around where there is no space between two quotation marks.  TEXT: <input type="text" name="text_field_21" value="Hello There!" />   so I ...
    Posted to Construction Advice (Forum) by I_SEEK on June 26, 2007
  • Re: alt tag search / relpace in Dreamweaver

    I don't own Dreamweaver, but I'll try to help you anyway. Try (<img\b[^>]*?\salt\s*=\s*"[^"]*) in the find field and $1 | appended text here in the replace field. This should also work, if the alt attribute comes after an href attribute.
    Posted to Construction Advice (Forum) by eSquire on April 27, 2007
1 2 Next >