ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 2nd, 2005, 12:04 AM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 37 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 8 sec
Reputation Power: 5
Unhappy REReplace to remove junk characters

hi. i would like a regular expression to remove all weird characters like this on the line below


if you can see it.
And like all those other non-english characters like the letter a with two dots on top etc etc.

I have a string with some text and html code. I need to remove these junk characters from it. Please help.

Reply With Quote
  #2  
Old August 3rd, 2005, 08:21 AM
Bastion Bastion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 181 Bastion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 4 h 25 m 11 sec
Reputation Power: 5
I've found these pages helpful when dealing with regular expressions.

http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000982.htm

http://www.activsoftware.com/resources/discussion/messages.cfm/id/1036

http://www.firstserv.com/support/coldfusion/documentation/coldfusion_5/Developing_ColdFusion_Applications/regexp7.html

Reply With Quote
  #3  
Old August 3rd, 2005, 06:01 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 37 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 8 sec
Reputation Power: 5
I've tried various methods and there just seems no way to match those "junk" characters... never found any documentation in relation to that either.
__________________
We can help export your products http://www.GIAgroup.com/

Reply With Quote
  #4  
Old August 3rd, 2005, 06:51 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
This is really a question about regular expressions and not a CF question. There are whole books and web sites about regular expressions so I'd start there, maybe with a Google search. I'm not much of a regex person myself or I'd offer a solution, but regex, as you may have guessed, can be a very advanced topic.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #5  
Old August 3rd, 2005, 10:51 PM
premzero premzero is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Sydney, AU
Posts: 37 premzero User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 8 sec
Reputation Power: 5
Talking

Found a simple solution that actually works!

Code:
[^\w\s[:punct:]]


Still need to test it more extensively but seems fine!
Ah finally! :P

For an amazing forum on regex check this out:
http://regexadvice.com/forums/

Cheers!
Prem

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > REReplace to remove junk characters


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT