Skip to content
Advertisement

Tag: hex

Need help figuring out how to write this Regex properly

I am trying to make a regex test that returns true for the following conditions: Can only have letters A-F (case insensitive) First character must be ‘#’ Can have numbers 0-9 Does not have punctuation The order does not matter except that string[0] should be ‘#’. So far I have: /^#[A-F0-9^!G-Z]/i but for some reason, it returns strings that have

How to convert Unicode Hex Characters to Latin-1 in JavaScript

I’m using rae-api to get the definition of the words in their dictionary. The problem is for example: I search for the definition of the word hola, it returns como salutación familiar.. I want to get the value of ó in Latin-1 characters: ó, therefore, the result would be como salutación familiar. getHex function removes &#; and returns xF3 to

Converting hexadecimal to float in JavaScript

I would like to convert a number in base 10 with fraction to a number in base 16. All is well there. Now I want to convert it back to decimal. But now I cannot write: As it doesn’t return the decimal part. And I cannot use parseFloat, since per MDC, the syntax of parseFloat is It wouldn’t have been

Advertisement