So I just got my sorry ass hacked, the hack put some obscure string in almost every one of the php files on my website. How can I remove every instance that line occurs?
The code it added started with <?php so therefore I cannot simply replace it with blank, I need to delete it and move up the actual relevant code up one line as <?php c...
I need to hide phone numbers (and maybe other contact details) in user generated content to protect my users from anonymous web. Input is very random, therefore
I'd be looking to replace anything that looks like a phone number (e.g.: string of 3 or more numbers) with just dots, and also perhaps remove some exotic notations of e-mail add...
I need to replace some text that is on the page within the body tag. I am using javascript but have jquery available if needed. I basically need to replace test (test with the registered trademark) with TEST or tests with TESTS and it could even be test with TEST or tests with TESTS. I am able to uppercase them but its not liking to work...
Is there a way to execute a SQL statement in SQLite to remove all the html from a TEXT field?
...
Please Help me in creating a replace function.
Problem:
Their is a alfanumeric value of any lenght (string) and i want to replace its all characters with 'X' except right four characters
Like :
Value : 4111111111111111
Result Should be: XXXXXXXXXXXX1111
I have created a function but got stuck:
public function myfunction...
public IQueryable<ArticleDisplay> SearchNumberOfArticles(int articleNr, string order)
var result = (
from category in db.ArticleCategories
join article in db.Articles on category.CategoryID equals article.CategoryID
orderby article.Date order
...
I've created a few input fields, that I am cleaning up as the user types.
So, I'm using a keystroke detection event, like .keyup()
It's all working very well, but I do notice one thing that's rather annoying for the users.
While the script is cleaning the data as they type, their cursor is being sent to the end of the input field.
So...
Hi, I currently have the following MySQL statement to replace the HTML entity for a single quote with an actual single quote:
update photo_galleries replace(title, ''', '\'');
This statement returns an error. I have tried adding additional backslashes, but this does not help at all. I want to run this command using pure SQL (no PH...
I'd like to use this method to create user-friendly URL. Because my site is in Croatian, there are characters that I wouldn't like to strip but replace them with another. Fore example, this string:
ŠĐĆŽ šđčćž
needs to be:
sdccz-sdccz
So, I would like to make two arrays, one that will contain characters that are to be replaced and other ...
I'm not very good at regex but maybe there's a simple way to achieve this task.
I'm given a string like "bla @a bla @a1 bla"
I'm also given pairs like {"a", "a2"} , {"a1", "a13"}, and I need to replace @a with @a2 for the first pair, and @a1 with @a13 for the second one.
The problem is when i use String.Replace and look for @a, it als...
In my application I have a string parameter called "shop" that is required in all controllers, but it needs to be transformed using code like this:
shop = shop.Replace("-", " ").ToLower();
How can I do this globally for all controllers without repeating this line in over and over?
Thanks,
Leo
...
I have an app that can make modify images. In some cases, this makes the filesize smaller, in some cases bigger.
The program doesn't have an option to "not replace the file if result has a bigger filesize".
So I wrote a little C# app to try and solve this.
Instead of overwriting the files, I make the app write the result to a folder u...
Hey
I have to search through a list and replace all occurrences of one element with another. I know I have to first find the index of all the elements, and then replace them, but my attempts in code are getting me nowhere. Any suggestions?
...
Hello guys,
I've searched but was unable to find an existing regex function. Has anybody done this before?
I wish to add a port number, or remove a potantially existing one from a url in php. To use in some functions which translate a given url to the secure one, unsecure one, etc.
Now I need a second SSL secured site on the server so...
Hey
I'm sure I've seen examples somewhere before, but I can't seem to find them. I have a page which has 5 buttons. I'd like each button to load up a different form, without refreshing. I could use UpdatePanels, but it sounds overkill for this (and bandwidth-costly). I'd like to load all the forms in one go, so clicking through the but...
This is the input string 23x * y34x2. I want to insert " * " (star surrounded by whitespaces) after every number followed by letter, and after every letter followed by number. So my input string would look like this: 23 * x * y * 34 * x * 2.
This is the regex that does the job: @"\d(?=[a-z])|a-z". This is the function that I wrote that i...
Hello,
I'm trying to replace certain text inside the div "info" when an image (which serve as links) is clicked. I'm just unsure of what methods could do this. I would prefer this be jquery.
My code so far looks like:
<div class="info">
<p>I would like this text replaced</p>
<script>
</script>
</div><!--end info-->
<li><a href="1....
I want to replace all line break (<br> or <br />) in a string with PHP. What regular expression I should have to do this, using preg_replace?
Thanks!
...
This is the input string "23x +y-34 x + y+21x - 3y2-3x-y+2". I want to surround every '+' and '-' character with whitespaces but only if they are not allready sourrounded from left or right side. So my input string would look like this "23x + y - 34 x + y + 21x - 3y2 - 3x - y + 2". I wrote this code that does the job:
Regex reg1 = n...
Hi there,
I have this
The body:
<body><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent leo leo, ultrices eu venenatis et, rutrum fringilla dolor.</p></body>
The code:
HtmlNode body = doc.DocumentNode.SelectSingleNode("//body");
Dictionary<HtmlNode, HtmlNode> toReplace = new Dictionary<HtmlNode, HtmlNode>();
/...