Error Exception: - Not enough hexadecimal digits

English support forum

Moderators: Stefan2, white, sheep, Hacker

User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Error Exception: - Not enough hexadecimal digits

Post by *makinero » 2018-12-28, 18:02 UTC

How to convert?

Code: Select all

Error Exception: - Not enough hexadecimal digits
Emoticons:
regex:[\x{1F600}-\x{1F64F}]

Miscellaneous Symbols and Pictographs:
regex:[\x{1F300}-\x{1F5ff}]

User avatar
Gral
Power Member
Power Member
Posts: 714
Joined: 2005-01-26, 15:12 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *Gral » 2018-12-28, 23:38 UTC


User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Error Exception: - Not enough hexadecimal digits

Post by *ghisler(Author) » 2018-12-30, 11:36 UTC

TC only supports 4 digit hex codes, sorry. The above codes use 2 16-bit unicode digits per character. You can't search for them.
It may work when searching for the two digits separately.
Author of Total Commander
http://www.ghisler.com

User avatar
tuska
Power Member
Power Member
Posts: 1520
Joined: 2007-05-21, 12:17 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *tuska » 2018-12-30, 12:04 UTC

☑ 'Everything' | How to use TC <=> Everything

Search for:

Code: Select all

ev:regex:[\x{1F600}-\x{1F64F}]
ed:regex:[\x{1F300}-\x{1F5ff}]
etc.
works.

----------------------------
"Everything" uses PCRE (Perl-Compatible Regular Expressions).
----------------------------

User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *makinero » 2019-01-01, 21:55 UTC

If you found a regex on the Internet that supposedly does what you want, it may not work as intended or at all if the creator of that regex was using a different application than you are. If you previously wrote a script using regular expressions in one programming language and you want to reuse some of those regexes in a new script in another language, then the regex may work differently in the other language or may require a syntax change. It works with "Everything" but it does not work with MasterSeeker.

Code: Select all

[ 1916] 01-01-2019 22:55:58.5063924 System.ArgumentException: analizowanie "regex:[\x{1F600}-\x{1F64F}]" - Za mało cyfr szesnastkowych.
                                       w System.Text.RegularExpressions.RegexParser.ScanHex(Int32 c)
                                       w System.Text.RegularExpressions.RegexParser.ScanCharEscape()
                                       w System.Text.RegularExpressions.RegexParser.ScanCharClass(Boolean caseInsensitive, Boolean scanOnly)
                                       w System.Text.RegularExpressions.RegexParser.CountCaptures()
                                       w System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
                                       w System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache)
                                       w #=qZJWc0mLBz7lxCZZrijayaAkhGOVi6IhMFy4SlawppP$b9T_1OnCKueOr25WM58fE.#=q$34yDd6IOFqfi5jRtSpRyCFrcjLnDByX3hCrJFFe6WM=()
                                       w #=qhSmZU0Dsm4vykY_ZVEre1uxR4d5Ba6d2zzsjok9jeMU=.#=qvQ76pefDmcEfU2Vdks6pkQ==(#=qZJWc0mLBz7lxCZZrijayaAkhGOVi6IhMFy4SlawppP$b9T_1OnCKueOr25WM58fE #=q8m8RWxIRR08Rjgf$5ovfnA==)

User avatar
tuska
Power Member
Power Member
Posts: 1520
Joined: 2007-05-21, 12:17 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *tuska » 2019-01-01, 22:45 UTC

makinero wrote:
2019-01-01, 21:55 UTC
It works with "Everything" but it does not work with MasterSeeker.
This is the forum of Total Commander and there was more than one answer to your question.
If you were planning to solve your problem with MasterSeeker anyway, this is the wrong forum.

I would therefore strongly advise you to consider in advance which forum you would like to use to ask your questions.

User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *makinero » 2019-01-02, 00:35 UTC

I used to contact the author of the program, I often received help, but now I do not. Probably that I have the last developer version and is no longer being developed.
The search engine does not support this type of regular expression, even though it copes well with most regular expressions.

User avatar
Hacker
Moderator
Moderator
Posts: 11229
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Error Exception: - Not enough hexadecimal digits

Post by *Hacker » 2019-01-02, 01:47 UTC

makinero wrote:I used to contact the author of the program, I often received help, but now I do not.
That is really strange.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

User avatar
HolgerK
Power Member
Power Member
Posts: 5070
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Error Exception: - Not enough hexadecimal digits

Post by *HolgerK » 2019-01-02, 08:44 UTC

2makinero
Because the .net regex engine only supports UTF-16 you have to split the UTF-32 into UTF-16 surrogates:

http://www.fileformat.info/info/unicode/char/1F600/index.htm \U0001F600 -> \uD83D\uDE00
http://www.fileformat.info/info/unicode/char/1F64F/index.htm \U0001F64F -> \uD83D\uDE4F
and search for a combination of the two UTF-16 characters:

Code: Select all

\uD83D[\uDE00-\uDE4F]
See also:
https://stackoverflow.com/questions/47605037/unicode-character-range-not-being-consumed-by-regex

Finally the point where the masterseeker or regexbuddy tools shows that "a fool with a tool is still a fool".

HTH
Holger
Make our planet great again

User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *makinero » 2019-01-02, 09:32 UTC

@*HolgerK - MasterSeeker is an application based on .NET.Framework. I checked, your regex works without error.

User avatar
petermad
Power Member
Power Member
Posts: 8405
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Error Exception: - Not enough hexadecimal digits

Post by *petermad » 2019-01-02, 12:06 UTC

2Hacker
That is really strange.
:D
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b4 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
Usher
Senior Member
Senior Member
Posts: 402
Joined: 2011-03-11, 10:11 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *Usher » 2019-01-02, 17:39 UTC

HolgerK wrote:
2019-01-02, 08:44 UTC
Because the .net regex engine only supports UTF-16 you have to split the UTF-32 into UTF-16 surrogates:
Why do you think it's UTF-32? In current Unicode version UTF-16 uses 2 or 4 bytes depending on Unicode range, see examples on Wikipedia: https://en.wikipedia.org/wiki/UTF-16#Examples
Regards from Poland
Andrzej P. Wozniak

User avatar
HolgerK
Power Member
Power Member
Posts: 5070
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Error Exception: - Not enough hexadecimal digits

Post by *HolgerK » 2019-01-02, 20:10 UTC

2Usher
What else should it be?
Your Wikipedia link only describes how the UTF-32 from makineros sample can be mapped to UTF-16 surrogates...
http://www.fileformat.info/info/unicode/char/1F600/index.htm wrote:
Encodings
Emoji grinning
HTML Entity (decimal) &#128512;
HTML Entity (hex) &#x1f600;
How to type in Microsoft Windows Alt +1F600
UTF-8 (hex) 0xF0 0x9F 0x98 0x80 (f09f9880)
UTF-8 (binary) 11110000:10011111:10011000:10000000
UTF-16 (hex) 0xD83D 0xDE00 (d83dde00)
UTF-16 (decimal) 55,357 56,832
UTF-32 (hex) 0x0001F600 (1F600)
UTF-32 (decimal) 128,512
C/C++/Java source code "\uD83D\uDE00"
Python source code u"\U0001F600"
Regards
Holger
Make our planet great again

User avatar
Usher
Senior Member
Senior Member
Posts: 402
Joined: 2011-03-11, 10:11 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *Usher » 2019-01-03, 04:06 UTC

2HolgerK
You can only guess what @makinero means. His messages mostly contain incomplete or misleading info.
Your information also seems to be incomplete or misleading, for newbies at least. It looks like you've forgotten Murphy's law: If @makinero may do something wrong, he will do it for sure.

So some explanations follow for newbies, lamers and the rest of us:

UTF-32 is NOT a synonym for Unicode, it's only one of Unicode encodings, it's Unicode Transformation Format. U+1F600 (1f600) is a Unicode code point (order number) of some character, its UTF-32 representation is always 4-byte, 8 hexadecimal (hex) digits long, so shorter numbers should be padded with zeros. Windows use mostly UTF-16 encoding, so info about UTF-32 is not really helpful.
It looks like @makinero doesn't know the difference, but he may also get some utf-16 or utf-8 code out of binary view and strip zeros.

There is lack of info about endianness (byte order) in the table you have quoted and you also ignore the byte order problem. Some people may not understand why they can't see the number from the table when using hex view in Lister.

Finally, you mentioned UTF-16 surrogates. There must be always ordered surrogate pairs. Single surrogate code point (one byte, 2 hex digits long) is not valid UTF-16 data and it should NOT be used in search.

Fix me if it's still incomplete or oversimplified explanation, let other users learn…
Regards from Poland
Andrzej P. Wozniak

User avatar
makinero
Senior Member
Senior Member
Posts: 268
Joined: 2013-10-26, 10:05 UTC

Re: Error Exception: - Not enough hexadecimal digits

Post by *makinero » 2019-01-03, 08:34 UTC

There are so many different expression engines that they will not work in many different applications. In .NET, regular expression patterns are defined by a special syntax or language, which is compatible z PERL?

xdigit
Any hexadecimal digit character, 0-9, a-f and A-F.

0xXX

\xXX


A hexadecimal character code, where XX is one or more hexadecimal digits (a Unicode character).

0xXXXX

\x{XXXX}


A hexadecimal character code, where XXXX is one or more hexadecimal digits (a Unicode character).

Post Reply