Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6957195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:58:07+00:00 2026-05-27T14:58:07+00:00

Basically the idea is to map the emoticons in the string to actual words.

  • 0

Basically the idea is to map the emoticons in the string to actual words. say for 🙂 you replace it with happy.
A more clear example would be.
Original:
Today is a sunny day :). But tomorrow it is going to rain :(.
Final:
Today is a sunny day happy. But tomorrow it is going to rain sad.

I have trying a solution using a common regex for all emoticons but I am not sure once you detect it is an emoticon, how to go back and replace each one with appropriate word.
I need it only for three emoticons :),:( and :D. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:58:08+00:00Added an answer on May 27, 2026 at 2:58 pm

    Use Regex.Replace method that takes a custom match evaluator.

    static string ReplaceSmile(Match m) {
        string x = m.ToString();
        if (x.Equals(":)")) {
            return "happy";
        } else if (x.Equals(":(")) {
            return "sad";
        }
        return x;
    }
    
    static void Main() {
        string text = "Today is a sunny day :). But tomorrow it is going to rain :(";
        Regex rx = new Regex(@":[()]");
        string result = rx.Replace(text, new MatchEvaluator(ReplaceSmile));
        System.Console.WriteLine("result=[" + result + "]");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this grand idea to basically employ some brute force attack to test/verify
basically need to change the value that - admin_url() returns any idea?
Basically i want to do the below in .NET but i have no idea
Basically, I would like a brief explanation of how I can access a SQL
I would like to store equivalences from Connected-component labeling algorithm . It's basically making
Basically the idea is to use the same hibernate mapping files for two different
My idea was to develop a traffic alert system on the android platform. Basically,
The idea basically is: Inside of myViewController NIB I have a UIView as a
I want to apply a function to a collection, map, etc, using Guava. Basically,
Basically idea is to grab data from MySQL table and transform it to JSON.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.