Comments (3)
Another exmaple,
Regex - ^(\\d{2})(?::(\\d{2})(?::(\\d{2})(?:[.,](\\d{1,9}))?)?|(\\d{2})(?:(\\d{2})(?:[.,](\\d{1,9}))?)?)?(?:(?:([zZ])|(?:([+\u2212-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?)?)(?:\\[((?:(?:\\.[-A-Za-z_]|\\.\\.[-A-Za-z._]{1,12}|\\.[-A-Za-z_][-A-Za-z._]{0,12}|[A-Za-z_][-A-Za-z._]{0,13})(?:\\/(?:\\.[-A-Za-z_]|\\.\\.[-A-Za-z._]{1,12}|\\.[-A-Za-z_][-A-Za-z._]{0,12}|[A-Za-z_][-A-Za-z._]{0,13}))*|Etc\\/GMT[-+]\\d{1,2}|(?:[+\\u2212-][0-2][0-9](?::?[0-5][0-9](?::?[0-5][0-9](?:[.,]\\d{1,9})?)?)?)))\\])?)?(?:\\[u-ca=((?:[A-Za-z0-9]{3,8}(?:-[A-Za-z0-9]{3,8})*))\\])?$
JS Result :-
[
"152343.121212121",
"15",
"23",
"43",
"121212121"
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
]
AS Result ;-
[
"152343.121212121",
"15",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"23",
"43",
"121212121"
]
Group 2,3,4 are now at the end.
from assemblyscript-regex.
Thanks @ashutoshvarma I'll investigate this issue shortly.
I'm still super pleased that this regex engine can handle such complex expressions! 😀
from assemblyscript-regex.
@ColinEberhardt Many thanks for bringing complete regex support to AS ecosystem!
Here is another example, (while porting test cases for PlainTime
I am finding many such cases )
It looks like extension of OP example,
Regex (Same as OP post, the PlainDateTIme
one) - "^((?:[+-]\\d{6}|\\d{4}))(?:-(\\d{2})-(\\d{2})|(\\d{2})(\\d{2}))(?:(?:T|\\s+)(\\d{2})(?::(\\d{2})(?::(\\d{2})(?:[.,](\\d{1,9}))?)?|(\\d{2})(?:(\\d{2})(?:[.,](\\d{1,9}))?)?)?)?(?:([zZ])|(?:([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\\d{1,9}))?)?)?)?)(?:\\[((?:(?:\\.\\.[-A-Za-z._]{1,12}|\\.[-A-Za-z_][-A-Za-z._]{0,12}|_[-A-Za-z._]{0,13}|[a-zA-Z](?:[A-Za-z._][-A-Za-z._]{0,12})?|[a-zA-Z]-(?:[-._][-A-Za-z._]{0,11})?|[a-zA-Z]-[a-zA-Z](?:[-._][-A-Za-z._]{0,10})?|[a-zA-Z]-[a-zA-Z][a-zA-Z](?:[A-Za-z._][-A-Za-z._]{0,9})?|[a-zA-Z]-[a-zA-Z][a-zA-Z]-(?:[-._][-A-Za-z._]{0,8})?|[a-zA-Z]-[a-zA-Z][a-zA-Z]-[a-zA-Z](?:[-._][-A-Za-z._]{0,7})?|[a-zA-Z]-[a-zA-Z][a-zA-Z]-[a-zA-Z][a-zA-Z](?:[-._][-A-Za-z._]{0,6})?)(?:\\/(?:\\.[-A-Za-z_]|\\.\\.[-A-Za-z._]{1,12}|\\.[-A-Za-z_][-A-Za-z._]{0,12}|[A-Za-z_][-A-Za-z._]{0,13}))*|Etc\\/GMT[-+]\\d{1,2}|(?:[+\\u2212-][0-2][0-9](?::?[0-5][0-9](?::?[0-5][0-9](?:[.,]\\d{1,9})?)?)?)))\\])?(?:\\[u-ca-((?:[A-Za-z0-9]{3,8}(?:-[A-Za-z0-9]{3,8})*))\\])?$"
JS -
[
"+0019761118T152330.1+0000",
"+001976",
null,
null,
"11",
"18",
"15",
null,
null,
null,
"23",
"30",
"1",
null,
"+",
"00",
"00",
null,
null,
null,
null
]
AS-
[
"+0019761118T152330.1+0000",
"+001976",
"",
"",
"15",
"",
"",
"",
"",
"",
"",
"+",
"00",
"00",
"",
"",
"23",
"30",
"1",
"11",
"18"
]
from assemblyscript-regex.
Related Issues (20)
- Feedback on "createRegExp" TODO comment
- Move to semantic versioning ... soon HOT 1
- Strategy for ensuring functional correctness? HOT 4
- Explore the use of as-pect HOT 3
- Add JavaScript's RegExp as baseline for benchmarks HOT 1
- Run the unit tests in TypeScript mode as well as WebAssembly / AssemblyScript HOT 1
- Should not return captured values for non-matching alternations HOT 2
- Help with the testing effort HOT 3
- Potential memory leak? HOT 2
- Run benchmark tests on node v15 HOT 3
- NFA includes some states that are redundant HOT 1
- capture groups with quantifiers should not be repeated in the returned results HOT 1
- Improve better error handling for malformed regex expressions
- Fail more visibly for unsupported features
- Prettier does not support function decorators
- Assertions within alternations are not supported HOT 2
- Add CI tests HOT 1
- Add NFA -> DFA transformation + optimizations in this domain HOT 6
- Terminology confusion: character set <=> character class HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assemblyscript-regex.