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 4072222
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:51:27+00:00 2026-05-20T16:51:27+00:00

I am using a hash containing 5000 items to match words in a sentence,

  • 0

I am using a hash containing 5000 items to match words in a sentence, it so occurs that when I match for eg: if($hash{$word}){Do Something} sometimes it happens that the period occurs in the word and even if it is a match the presence of period results in a non-match. Can anything be done to ignore any punctuations when matching with hashes?

  • 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-20T16:51:28+00:00Added an answer on May 20, 2026 at 4:51 pm

    You would have to redefine the words you look up to exclude the punctuation, remembering that you might or might not want to eliminate all punctuation (for example, you might want to keep dashes and apostrophes – but not single quotes).

    The crude technique – not recognizing any punctuation is:

    $key = $word;
    $key ~= s/\W//g;  # Any non-word characters are removed
    if (defined $hash{$key}) { DoSomething; }
    

    You can refine the substitute command to meet your needs.

    But the only way to make sure that the hash keys match is to make sure that the hashed key matches – so you need to be consistent with what you supply.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario that when I try to access a hash key using
Greetings, I have some mysql tables that are currently using an md5 hash as
when using oracle forms to generate md5 hash, i get result that is different
I'm using jQuery. I have a JS file (super.js) containing: $(#content).load(/profile); function setHash(hash) {
I find myself using hash arguments to constructors quite a bit, especially when writing
Should I implement named parameters in Java using Hash tables? I saw this entry:
I'm using a hash table (source code by Google Inc) to store some method
In a WinForm application using C#.NET 2.0 (on Vista), I am using SHA1 hash
what kind of 'unique' system identifiers can be easily obtained using C# (to hash
After removing hash from URL using window.location.hash='' page getting reloaded in firefox. EDIT Example:

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.