Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Need help on replace using regular expression
Edgar Santos
Apr 9 2008 6:51 AM
7.9k
Reply
Hi.
I have the following string "aaaaaa££aaaaa£aaaaa££"
and i want to replace £ for € and ££ for £.
(the string may change, but the rules are the same)
i've tried doing the following :
stringvar.replace(/[£]/g,"\u20AC")).replace(/[££]/g,"£")
It's obvious that the first replace replaces all £ by €..so the second replace never happens.
I'm trying to find a regular expression that helps me on this case, like saying to the replace that if he find a £ isolated from other £ he can replace for €. If not replace with £.
Hope you can help.
Cheers.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Webbrowser and layout changing of current page
Applying Javascript to Sitemap file to open Word Doc in new window