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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:46:15+00:00 2026-05-23T14:46:15+00:00

I have a regex that needs to match a bunch of characters. The code

  • 0

I have a regex that needs to match a bunch of characters. The code has no problem is ruby 1.8.7 but in 1.9 it kills over. I guess it has to do with encoding, I’ve done a good chunk of google searches so maybe someone can enlighten me.

Code:

# encoding: utf-8
non_latin_hashtag_chars = [
  (0xA960..0xA97F).to_a, # Hangul Jamo Extended-A
  (0xAC00..0xD7AF).to_a, # Hangul Syllables
  (0xD7B0..0xD7FF).to_a  # Hangul Jamo Extended-B
].flatten.pack('U*').freeze

e = /[a-z_#{non_latin_hashtag_chars}]/io

Error:

~/Desktop: ruby regex_test.rb 
regex_test.rb:13:in `<main>': too many multibyte code ranges are specified: /[a-z_가각갂갃간갅갆갇갈갉갊갋갌갍갎갏감갑값갓갔강갖갗갘같갚갛개객갞갟갠갡갢갣갤갥갦갧갨갩갪갫갬갭갮갯갰갱갲갳갴갵갶갷갸갹갺갻갼갽갾갿걀걁걂걃걄걅걆걇걈걉걊걋걌걍......
  • 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-23T14:46:16+00:00Added an answer on May 23, 2026 at 2:46 pm

    As twehad points out, there is a 10k limit in regexp.

    In anycase, you should use unicode ranges within the Regexp:

    /[a-z_\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF]/io
    

    I’m not an expert in Korean so I don’t know if it is equivalent, but if you want to match all Hangul characters, you should use the class for that instead:

    /[a-z_\p{Hangul}]/io
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a Regex that will match a java method declaration. I have come
I have a RegEx that is working for me but I don't know WHY
I have the following regex that isn't working. I want to match the string
I need to have a RegEx that will match a URI like this based
^(.)+\S{10}(.)+$ I have that regex which will match any string that contains a word
I would like to match url pattern that has optional segments. I have URL-s
I have a fairly simple regex problem for a little personal experiment that I
I need to write a regex which will match URLs that do not have
Have to write a Regex that will match following: <a href=../../_asp/link.asp?link=sp1234.htm and <a href=../../_asp/link.asp?link=AL432123.htm
I have a regex call that I need help with. I haven't posted my

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.