Skip to content

kddnewton/exreg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exreg

A non-backtracking Unicode regular expression library written in Ruby.

Usage

require "exreg"

pattern = Exreg::Pattern.new("abc")
pattern.match?("xxx abc yyy zzz") # => true

Features

Exreg implements almost all of the same features as the Unicode subset of Onigmo, the regular expression library used in Ruby. This includes everything except the following major features:

  • Full case folding (only common case folding is supported)
  • Look-ahead and look-behind assertions ((?=subexp), (?!subexp), (?<=subexp), (?<!subexp))
  • Backreferences (\n, \k<n>, etc.)

It also does not implement these less-commonly used features:

  • Extended form (x option)
  • Extended grapheme cluster (\X)
  • Keep expression (\K)
  • The cursor anchor (\G)
  • Conditional expressions ((?(cond)yes-subexp), (?(cond)yes-subexp|no-subexp))
  • Absence operator ((?~subexp))
  • Backreference with recursion level (\k<n+level>)
  • Subexpression calls (\g<n>)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kddnewton/exreg.

License

The gem is available as open source under the terms of the MIT License.

About

A Unicode regular expression library written in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages