Giter Site home page Giter Site logo

"from" attribute is always zero about gohs HOT 3 CLOSED

flier avatar flier commented on July 29, 2024
"from" attribute is always zero

from gohs.

Comments (3)

flier avatar flier commented on July 29, 2024

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.

 avatar commented on July 29, 2024

@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.

flier avatar flier commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.