Quantcast
Channel: Everyday I'm coding » regex
Browsing all 10 articles
Browse latest View live

How to do a regular expression replace in MySQL?

I have a table with ~500k rows; varchar(255) UTF8 column filename contains a file name; I’m trying to strip out various strange characters out of the filename – thought I’d use a character class:...

View Article



How does StackOverflow generate its SEO-friendly URLs?

What is a good complete Regex or some other process that would take the title: How do you change a title to be part of the URL like Stackoverflow? And turn it into...

View Article

What is a Context Free Grammar?

can someone explain to me what a context free grammar is? After looking at the wikipedia entry and then the wikipedia entry on formal grammar, I am left utterly and totally befuddled. Would someone be...

View Article

C# Convert Relative to Absolute Links in HTML String

I’m mirroring some internal websites for backup purposes. As of right now I basically use this c# code: System.Net.WebClient client = new System.Net.WebClient(); byte[] dl = client.DownloadData(url);...

View Article

Why are regular expressions so controversial?

On the one hand, there are many people who seem to see regular expressions as the holy grail. Something that looks so complicated just must be the answer to any question. They think that every problem...

View Article


Regular expressions in an Objective-C Cocoa application

Initial Googling indicates that there’s no built-in way to do regular expressions in an Objective-C Cocoa application. So four questions: Is that really true? Are you kidding me? Ok, then is there a...

View Article

Image may be NSFW.
Clik here to view.

How do you debug a regex? [closed]

Regular expressions can become quite complex. The lack of white space makes them difficult to read. I can’t step though a regular expression with a debugger. So how do experts debug complex regular...

View Article

How can I make my match non greedy?

I have a big HTML file that has lots of markup that looks like this: <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <span style="font-size: small; font-family: Times New Roman;">stuff...

View Article


Image may be NSFW.
Clik here to view.

How does this giant regex work?

I recently found the code below in one of my directories, in a file called doc.php. The file functions or links to a file manager. It’s quite nicely done. Basically, it lists all the files in the...

View Article


Non greedy regex matching in sed?

I’m trying to use sed to clean up lines of URLs to extract just the domain.. So from: http://www.suepearson.co.uk/product/174/71/3816/ I want: http://www.suepearson.co.uk/ (either with or without the...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images