MaxSchmeling

MaxSchmeling

20p

16 comments posted · 0 followers · following 0

14 years ago @ Max Schmeling - Replace Query String P... · 0 replies · +1 points

Please see this post on my new blog: http://maxschmeling.me/?p=89

14 years ago @ Max Schmeling - RegEx FAIL - Answer · 0 replies · +1 points

The only way I can think of doing that might be to do an or with $ (end of line) so that it either finds the parameter or finds the end of the line and does a replacement. If you can try that out and post back that would be great. If you don't, I'll see if I can get it working after a bit.

14 years ago @ Max Schmeling - RegEx FAIL - Answer · 0 replies · +1 points

You're absolutely right, Leo. That regex is flawed even still.

I took some time and came up with a much better expression, that's much simpler and actually works. Try this instead: "{0}=[^&]+"

Full Method:
public static string ReplaceValue(string url, string parameter, string newValue)
{
return Regex.Replace(url, string.Format("{0}=[^&]+", parameter),
string.Format("{0}={1}", parameter, newValue), RegexOptions.IgnoreCase);
}

Thank you for pointing out the issue. I've only used the code for really simple urls so I'll have to replace it with the updated method that will work with any url.

14 years ago @ Max Schmeling - Who are you comparing ... · 0 replies · +1 points

Thanks for the correction. I typed it into my feed reader wrong when I subscribed and have been reading it that way ever since. *sigh* stupid typos.

14 years ago @ Max Schmeling - Who are you comparing ... · 0 replies · +1 points

I'd say Jeff Atwood himself is a pretty good one to compare yourself too, he's had a tad bit of success.

14 years ago @ Max Schmeling - Finite State Machine R... · 1 reply · +1 points

I thought it was worth sharing.

14 years ago @ Max Schmeling - RegEx FAIL · 0 replies · +1 points

I have already posted a follow up shortly after this post. I'll update this entry to show the link.

http://maxschmeling.blogspot.com/2009/01/regex-fa...

14 years ago @ Max Schmeling - Extension Method for E... · 0 replies · +1 points

Yeah, I think Blogger ripped out the <T>... i'll see if I can get that fixed

14 years ago @ Max Schmeling - AzMan Documentation · 0 replies · +1 points

On one hand I'd hate to see that happen because the security model is so nice, but on the other hand I think somebody else needs to make a better system based on the same model.

14 years ago @ Max Schmeling - Authorization Manager · 0 replies · +1 points

I'd be glad to help you. Email me (schmeling88 [at] gmail.com) and I'll be glad to give you some tips or if you're looking for consulting I could possibly help you out in that way too.