Comments (4)
Yes, the second form you have in flex there is the correct one.
from flex.
The thing is if both uses the same strategy (dfa) why one works and the other don't ?
I mean regular expressions work but flex doesn't with both regexes.
from flex.
With this \"(?:\\.|[^\"\n\r])*\"|'(?:\\.|[^'\n\r])*'
and this \"(?:\\.|[^\"\n\r\\])*\"|'(?:\\.|[^'\n\r\\])*'
regex on https://regex101.com/ the following languages recognize all strings: Java8
, Golang
, Python
, Javascript
and PCRE
.
from flex.
Those other implementations aren't using DFA/leftmost longest.
There are actually multiple regex flavours, but let's keep things simple.
from flex.
Related Issues (20)
- Add Scorecard Action to monitor project's security posture HOT 2
- Broken yywrap()?
- Some situation where flex generated cpp code generates an access out-of-bounds HOT 2
- FYI: New warning for C++ lexer with gcc 13 -Wall
- BSD licensing while containing GPL-2.0 header in some files HOT 2
- Docs typo: C++ header file is FlexLexer.h not yyFlexLexer.h HOT 1
- aarch64-linux-gnu-gcc build flex2.6.4 will error HOT 2
- C-99 comment rule flawed HOT 13
- Inconsistent handling of in memory buffers compared to file buffers
- question HOT 1
- can't enlarge buffer, but no REJECT HOT 11
- Build without info/man/examples HOT 2
- Potential out-of-bounds access of `yy_nxt` HOT 7
- Buffer overflow with `-CF -8` options and 0x00 0xFF input HOT 23
- Fix sed incompatibilities on MacOS X HOT 10
- Cannot match non-ASCII characters HOT 1
- Flex segfaults after reading EOF in `input()` HOT 2
- Noob question: Where's the makefile? HOT 5
- crash when yylex HOT 1
- Where is the publishing GPG / PGP key? HOT 1
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 flex.