Comments (3)
Yes, for better performance, hyperscan
will ignore the from
attribute by default, you need use the SOM_LEFTMOST flag when compile the pattern.
from gohs.
@flier thanks for this
I tried with "iuml" flag and gives me a weird result, it repeats the BtcAddressPattern multiple time as there is only one occurence.
{
"Errno": 0,
"Msg": "",
"Data": [
{
"Id": 15,
"From": 23,
"To": 49,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 50,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 51,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 52,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 53,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 54,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 55,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 56,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 15,
"From": 23,
"To": 57,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "[13][a-km-zA-HJ-NP-Z1-9]{25,34}",
"Data": " BtcAddressPattern "
}
},
{
"Id": 28,
"From": 214,
"To": 246,
"Flags": 0,
"Context": "[email protected] 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v https://twitter.com/x0rxkov random test sentence https://twitter.com/twitter\n\nhttps://github.com/lucmichalski\nhttps://github.com/lucmichalski/cars-dataset\n\n[email protected]:fastai/fastai.git\n\n\n",
"RegexLinev": {
"Expr": "((git|ssh|http(s)?)|(git@[\\w\\.]+))(:(\\/\\/)?)([\\w\\.@\\:/\\-~]+)(\\.git)(\\/)?",
"Data": " GitRepoPattern "
}
}
]
}
from gohs.
Yes, hyperscan
will reports all the matching, you need merge the matches base on from..to like this.
I'll port those syntax sugars later, but you can implement them if you need something similar.
from gohs.
Related Issues (20)
- How to use it by right method? HOT 2
- Any plans to support Chimera?
- go get uses gcc not g++
- Missing mapping for using ExprExt in hs_compile_ext_multi()
- Scratch space and gorutines HOT 3
- bug: blockMatcher/streamMatcher.Match returns false for exact matches
- cgo call C.hs_scan performance is much lower than hyperscan in C HOT 1
- Build issue with hyperscan 5.1.0-1 and gohs v1.1.1 HOT 3
- Incorrect match result on high load HOT 1
- Is it possible to return the matching index position in the callback interface HOT 2
- How to use gohs on Windows(use Goland to development)? HOT 1
- Package libhs was not found in the pkg-config search path HOT 1
- error while loading shared libraries: libhs.so.5: HOT 1
- link with libchimera fail, need help HOT 1
- cgo preprocessing failed with Hyperscan library on Linux amd64 HOT 2
- gohs in multicore
- build simplerep faild
- no docs for chimera (https://pkg.go.dev/github.com/flier/gohs/chimera)
- how to write libhs.pc in windows HOT 4
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 gohs.