Removed #5 Posted September 29, 2011 Report Share Posted September 29, 2011 I'm trying to do a fairly simple replace with regex (in visual basic). I could write code, but regex should handle it simpler ... given (from usenet) a file name, copied into a string and passed as strTemp, which may look like: "China_Huxley, Aldous _ [Travel Series 03]" desired: "China Huxley Aldous Travel Series 03" strTemp = Regex.Replace(strTemp, "[^\w\s\@-]", String.Empty) comes close but I still end up with either multiple or no spaces between words. and what the blazes is "\@" why escape the at sign?? Ignorance may be bliss, but it's irritating me ... any help?? //al Quote Link to comment Share on other sites More sharing options...
Sarah Posted September 29, 2011 Report Share Posted September 29, 2011 @Marc you must know this? Quote Link to comment Share on other sites More sharing options...
Marc Posted September 29, 2011 Report Share Posted September 29, 2011 hehehe the evil regex lol VB.NET or VB6? Quote Link to comment Share on other sites More sharing options...
Removed #5 Posted September 29, 2011 Author Report Share Posted September 29, 2011 vb2005 vb.net one of the fellows on the msdn forum gave me a working regex, simple but I'm fÃÂng confused! (( I hate regex, even when I realize how powerful they can be! )) Quote Link to comment Share on other sites More sharing options...
Marc Posted September 29, 2011 Report Share Posted September 29, 2011 vb2005 vb.net one of the fellows on the msdn forum gave me a working regex, simple but I'm fÃÂng confused! (( I hate regex, even when I realize how powerful they can be! )) lmfao ...... no worries. Give me a shout if you need anything else regarding .NET. Thats what I do for a living Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.