How can I use Unicode-aware regular expressions in JavaScript? For example, there should be something akin to \w that can match any code-point in Letters or Marks category (not just the ASCII ones), and hopefully have filters like [[P*]] for punctu...
I am building search and I am going to use javascript autocomplete with it. I am from Finland (finnish language) so I have to deal with some special characters like ä, ö and å When user types text in to the search input field I try to match the...
I'm trying to convert a unicode string to a hexadecimal representation in javascript. This is what I have: function convertFromHex(hex) { var hex = hex.toString();//force conversion var str = ''; for (var i = 0; i < he...
I need to compare 2 strings as equal such as these: Lubeck == Lübeck In JavaScript. Why? Well, I have an auto-completion field that's going out to a Java service using Lucene, where place names are stored naturally (as Lübeck), but als...
Here's a fun snippet I ran into today: /\ba/.test("a") --> true /\bà/.test("à") --> false However, /à/.test("à") --> true Firstly, wtf? Secondly, if I want to match an accented character at the start...
I've found some letters but i need to find others such as "c", "m", "p", is this even possible?...
I take user-input (JS code) and execute (process) them in realtime to show some output. Sometimes the code has those zero width space, it's really weird. i don't know how the users are input'ing that. Example - "(?$".length ===...
I need to convert the punycode NIATO-OTABD to nñiñatoñ. I found a text converter in JavaScript the other day, but the punycode conversion doesn't work if there's a dash in the middle. Any suggestion to fix the "dash" issue?...
I need to insert an Omega (?) onto my html page. I am using its HTML escaped code to do that, so I can write Ω and get ?. That's all fine and well when I put it into a HTML element; however, when I try to put it into my JS, e.g. var Om...
(You'll need Firefox or Safari to see the emoji in the code.) I want to take a string of emoji and do something with the individual characters. In JavaScript "?????????????????????????".length == 13 because "?" length is 1, the...
©2020 All rights reserved.