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

Browse by Tags

All Tags » regex » replace
  • Optimizing a string replacement algorithm in javascript

    Ok so I have a rather slow algorithm that I would really love some advice to speed up! It may repeat many times over different large data strings. The string 'data' contains "variables" (denoted by ${myVarName} in the data) that must be replaced with the value of the corresponding (either by id or name) element on the html page. ...
    Posted to Performance (Forum) by floss on May 9, 2011
  • find if either stringa or stringb do not exist in a string

    I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works: /(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi  what I want it to do is if [*code] and [*/code] are around the text inside, ...
    Posted to Construction Advice (Forum) by sarathi on July 31, 2009
  • Date increment

    Hi all, first post, so I hope I'm posting this correctly. I need to increment the hour in JavaScript by 1 (i.e. I need to get the current hour, add an hour, and then return the answer). An example of the string is as follows (the hour is bolded): 2009-05-18T16:15:00Z I'm re-learning RegEx after not visiting it for years, so I'd ...
    Posted to Construction Advice (Forum) by regexn00bpain on May 18, 2009
  • Insert missing trademark and registered symbols

    Hi I`m using ASP.NET C# and need to create a web application to autofix some text where company name and product names are missing ®(registered) and ™(trademark) symbols. We have a huge amount of text as articles in 30 different languages. I`m planning to use RegExs MatchCollection to find all hits in each article and then replace ...
    Posted to Construction Advice (Forum) by nestur on December 9, 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
  • Find substring

    Hello everybody, I almost feel bad about writing here - but I really tried for days now. I need a string filtered (matched) from a string like this:   @s My Company Ltd@o My-Street-adress 123@o New York@pt 123-35-144@t Mobile@pt 593-1195-1395   I am trying to filter out the company´s name (which always is from the beginning of ...
    Posted to Construction Advice (Forum) by christophn on April 25, 2007
  • Search & Remove a regex string within a DB field

    Hi,  I'm working in c# 1.1 so I have access to Regex.Replace (and even MatchEvaluators if that makes life easier) but I figure there must be a relatively simple regex way of doing this? I have a set of strings which I need to remove (if they occur) within a string field on a database row.  I figure that I can run a regex on ...
    Posted to Construction Advice (Forum) by DaveR on March 13, 2007
  • Replacing all spaces with an underscore in .htaccess?

    I can't do this serverside because it has to parse in the .htaccess first. Basically, I have the following string: RewriteRule ^([A-Za-z0-9_]+)$ index.php?word=$1 which makes: mysite.com/this go to mysite.com/index.php?word=this But, if someone puts in mysite.com/what is this it will error out.  I want it to convert all the ...
    Posted to Construction Advice (Forum) by FuzzzyLogik on December 14, 2006