|
|
Browse by Tags
All Tags » regex » replace
-
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. ...
-
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, ...
-
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 ...
-
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 ...
-
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 ...
-
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, ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
|
|
|