https://github.com/biojulia/automa.jl
A julia code generator for regular expressions
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
3 of 12 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A julia code generator for regular expressions
Basic Info
Statistics
- Stars: 192
- Watchers: 14
- Forks: 16
- Open Issues: 9
- Releases: 28
Topics
Metadata Files
README.md
Automa.jl
Automa is a regex-to-Julia compiler.
By compiling regex to Julia code in the form of Expr objects,
Automa provides facilities to create efficient and robust regex-based lexers, tokenizers and parsers using Julia's metaprogramming capabilities.
You can view Automa as a regex engine that can insert arbitrary Julia code into its input matching process, which will be executed when certain parts of the regex matches an input.

Automa is designed to generate very efficient code to scan large text data, often much faster than handcrafted code.
For more information read the documentation, or read the examples below and in the examples/ directory in this repository.
Examples
Validate some text is composed only of ASCII alphanumeric characters
```julia using Automa
generatebuffervalidator(:validate_alphanumeric, re"[a-zA-Z0-9]*") |> eval
for s in ["abc", "aU81m", "!,>"] println("$s is alphanumeric? $(isnothing(validate_alphanumeric(s)))") end ```
Making a lexer
```julia using Automa
tokens = [ :identifier => re"[A-Za-z][0-9A-Za-z!]*", :lparens => re"(", :rparens => re")", :comma => re",", :quot => re"\"", :space => re"[\t\f ]+", ]; @eval @enum Token errortoken $(first.(tokens)...) make_tokenizer((errortoken, [Token(i) => j for (i,j) in enumerate(last.(tokens))] )) |> eval
collect(tokenize(Token, """(alpha, "beta15")""")) ```
Make a simple TSV file parser
```julia using Automa
machine = let name = onexit!(onenter!(re"[^\t\r\n]+", :mark), :name) field = onexit!(onenter!(re"[^\t\r\n]+", :mark), :field) nameline = name * rep('\t' * name) record = onexit!(field * rep('\t' * field), :record) compile(nameline * re"\r?\n" * record * rep(re"\r?\n" * record) * rep(re"\r?\n")) end
actions = Dict( :mark => :(pos = p), :name => :(push!(headers, String(data[pos:p-1]))), :field => quote nfields += 1 push!(fields, String(data[pos:p-1])) end, :record => quote nfields == length(headers) || error("Malformed TSV") n_fields = 0 end )
@eval function parsetsv(data) headers = String[] fields = String[] pos = nfields = 0 $(generate_code(machine, actions)) (headers, reshape(fields, length(headers), :)) end
header, data = parse_tsv("a\tabc\n12\t13\r\nxyc\tz\n\n") ```
Owner
- Name: BioJulia
- Login: BioJulia
- Kind: organization
- Website: https://biojulia.dev
- Repositories: 79
- Profile: https://github.com/BioJulia
Bioinformatics and Computational Biology in Julia
GitHub Events
Total
- Create event: 1
- Commit comment event: 2
- Issues event: 2
- Release event: 1
- Watch event: 2
- Issue comment event: 8
- Push event: 5
- Pull request review event: 1
- Pull request event: 5
- Fork event: 1
Last Year
- Create event: 1
- Commit comment event: 2
- Issues event: 2
- Release event: 1
- Watch event: 2
- Issue comment event: 8
- Push event: 5
- Pull request review event: 1
- Pull request event: 5
- Fork event: 1
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Kenta Sato | b****5@g****m | 179 |
| Jakob Nybo Nissen | j****n@g****m | 126 |
| Kevin Bonham | k****m@g****m | 6 |
| Ben J. Ward | w****0@g****m | 5 |
| Ciarán O'Mara | C****a@u****u | 2 |
| SundaraRaman R | s****r@a****n | 2 |
| nhz2 | n****2@c****u | 2 |
| = | = | 1 |
| Daniel C. Jones | d****s@c****u | 1 |
| Elliot Saba | s****t@g****m | 1 |
| denshd | 7****d | 1 |
| femtocleaner[bot] | f****] | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 47
- Total pull requests: 73
- Average time to close issues: 7 months
- Average time to close pull requests: about 1 month
- Total issue authors: 14
- Total pull request authors: 12
- Average comments per issue: 2.17
- Average comments per pull request: 1.73
- Merged pull requests: 67
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 1
- Pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: about 2 hours
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jakobnissen (31)
- Kolaru (4)
- jtrakk (1)
- Azzaare (1)
- richardreeve (1)
- andreypopp (1)
- sjoelund (1)
- tlienart (1)
- lesshaste (1)
- cmcaine (1)
- jagot (1)
- racinmat (1)
- SabrinaJaye (1)
- JuliaTagBot (1)
Pull Request Authors
- jakobnissen (44)
- bicycle1885 (15)
- kescobo (3)
- SabrinaJaye (3)
- nhz2 (2)
- femtocleaner[bot] (2)
- digital-carver (2)
- richiejp (1)
- denshd (1)
- dcjones (1)
- CiaranOMara (1)
- macd (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 4,275 total
- Total dependent packages: 19
- Total dependent repositories: 18
- Total versions: 12
juliahub.com: Automa
A julia code generator for regular expressions
- Documentation: https://docs.juliahub.com/General/Automa/stable/
- License: MIT
-
Latest release: 1.1.0
published over 1 year ago
Rankings
Dependencies
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-docdeploy latest composite
- actions/checkout v2 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/setup-julia v1 composite
- JuliaRegistries/TagBot v1 composite
- actions/checkout v2 composite
- codecov/codecov-action v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest latest composite
- julia-actions/setup-julia v1 composite