characters (5,315)


Generate list of all possible permutations of a string

Generate list of all possible permutations of a string

How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters. Any language would work, but it should b…


Regex: To pull out a sub-string between two tags in a string

I have a file in the following format: Data Data Data[Start] Data I want[End] Data I'd like to grab the Data I want from between the[Start] and[End] tags using a Regex. Can anyone show me how th…


How can I get at the matches when using preg_replace in PHP?

I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using preg_replace for extract and wrapping purposes, but it's not outputting anything. preg_replace("/[A…


mysql What do I need to escape when sending a query?

When you execute a SQL query, you have to clean your strings or users can execute malicious SQL on your website. I usually just have a function escape_string(blah), which: Replaces escapes(\) with…


language agnostic How do you typeset code elements in normal text?

What is the best way to typeset a function with arguments for readibility, brevity, and accuracy? I tend to put empty parentheses after the function name like func(), even if there are actually argum…


SQL Server Escape an Underscore

How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with_d at the end. Where Username Like '%_d'…


Remove Quotes and Commas from a String in MySQL

I'm importing some data from a CSV file, and numbers that are larger than 1000 get turned into 1,100 etc. What's a good way to remove both the quotes and the comma from this so I can put it into an…


Strange characters in PHP

This is driving me crazy. I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became<? print 'Hello'; ?> it outputs Hello if I creat…



python Regex and unicode

I have a script that parses the filenames of TV episodes(show.name.s01e02.avi for example), grabs the episode name(from the www.thetvdb.com API) and automatically renames them into something nicer(…


c# UrlEncode through a console application?

Normally I would just use: HttpContext.Current.Server.UrlEncode("url"); But since this is a console application, HttpContext.Current is always going to be null. Is there another method that does the…




string special character how remove from regex replace java unicode