Jump to content

Anyoone good with regex??


Removed #5

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy , along with dressing your husky as a unicorn on the first Thursday of each month