New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

solregex

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solregex - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

.eslintrc.js

33

package.json
{
"name": "solregex",
"version": "0.1.1",
"description": "solidity regex library",
"version": "0.1.2",
"description": "generates Solidity smart contracts to match regular expressions",
"author": "g. nicholas d'andrea <nick@gnidan.org>",
"license": "MIT",
"bin": {
"solregex": "index.js"
"solregex": "dist/main.bundle.js"
},
"dependencies": {
"scripts": {
"lint": "eslint ./src",
"compile": "webpack",
"prepublish": "webpack -p",
"clean": "rm -rf ./dist"
},
"keywords": [
"solidity",
"regex",
"ethereum"
],
"devDependencies": {
"argparse": "^1.0.9",
"automata.js": "^0.2.1"
}
"automata.js": "^0.2.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-runtime": "^6.23.0",
"eslint": "^3.0.0",
"eslint-loader": "^1.7.1",
"webpack": "^2.6.1",
"webpack-dev-server": "2"
},
"repository": "git@github.com:gnidan/solregex.git"
}

67

README.md

@@ -1,14 +0,52 @@

Regexes in Solidity
===================
solregex
========
Simple regular expression matcher contract generation for Solidity.
Tool to generate a Solidity smart contract for a given regular expression.
Generates Solidity smart contract source file matching a particular regular
expression.
Uses [Automata.js](https://github.com/hokein/Automata.js), limited by
Automata's support for regex components:
Install
-------
> Currently, Automata.js supports minimal regular expressions:
```
npm install -g solregex
```
Usage
-----
```
$ solregex --name BasicRegex 'a+(ab)*b+' > ./contracts/BasicRegex.sol
```
Status / Motivation
-------------------
**Proof-of-concept** currently.
This project is probably not currently useful for most regexes you'd want.
Some limitations:
- Extremely limited syntax. Does not support `.` or `[]` currently, let alone
backreferences, etc.
- Very bad performance for everything but the most simple regular expressions.
**Why?**
Hopefully to inspire additional work on the problem. It'd be nice to have
performant regexes on the EVM, with the usual modern regex bells and whistles.
This project currently uses [Automata.js](https://github.com/hokein/Automata.js)
for regex parsing and state machine descriptions.
Currently, this takes a very naïve approach with basically everything, so as to
quickly achieve minimal matching functionality. My hope is that it should be
fairly straightforward to apply some simple, known techniques in order to
produce a more robust / gas-efficient implementation.
Supported Syntax
----------------
From Automata.js:
> * `+`: One or more

@@ -25,14 +63,1 @@ > * `*`: Zero

Install
-------
```
npm install -g solregex
```
Usage
-----
```
$ solregex --name BasicRegex 'a+(ab)*b+' > ./contracts/BasicRegex.sol
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc