robpike / unicode Goto Github PK
View Code? Open in Web Editor NEWUnicode is a command-line utility for browsing the Unicode database.
License: Other
Unicode is a command-line utility for browsing the Unicode database.
License: Other
It would be really helpful a readme can be created with installation and usage examples
When specifying multiple regexps with -g, like-g 'regexp1' 'regexp2'
, the final list of codes reflects the order in which they were found by the individual regexps. Also, if regexp1 and regexp2 have any overlap in their matches, the final list of codes will have duplicates.
In the example below the first two regexps are identical, the third captures the special case of lamda which has a Unicode 1.0 name:
unicode -t -g '\tgreek small letter \w+$' '\tgreek small letter \w+$' '\tgreek small letter \w+;'
ͱαβγδεζηθικμνξοπρστυφχψωϛϝϟϡϸϻͱαβγδεζηθικμνξοπρστυφχψωϛϝϟϡϸϻλ
I'd like codes to at least be deduplicated before output (the "found order" can be preserved):
unicode -t -g '\tgreek small letter \w+$' '\tgreek small letter \w+$' '\tgreek small letter \w+;'
ͱαβγδεζηθικμνξοπρστυφχψωϛϝϟϡϸϻλ
and optionally sorted, lamda now prints after kappa:
unicode -t -g -s '\tgreek small letter \w+$' '\tgreek small letter \w+$' '\tgreek small letter \w+;'
ͱαβγδεζηθικλμνξοπρστυφχψωϛϝϟϡϸϻ
I was trying to search for the 24 small Greek letters with a regexp like ^greek small letter \w+$
based on what I was seeing using the -d flag.
After actually looking in the code at argsAreRegexps(), I can see the internal format of the string that each regexp is applied to looks like, {Codepoint}\t{Name}[; {Unicode 1.0 Name}]
; the square brackets denote that the semicolon and Unicode 1.0 name are optional. With that knowledge I was able to come up with -d -g '\tgreek small letter \w+$' '\tgreek small letter \w+;'
(which gets me 31 letters, the closest I think I'll get).
I'd like to see at least a small mention in documentation to reflect this and hopefully give users some insight into how to compose their regexps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.