
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
regexp_property_values
Advanced tools
This small library lets you see which property values are supported by the regular expression engine of the Ruby version you are running and directly reads out their codepoint ranges from there.
That is, it determines all supported values for \p{value}
expressions and what they match.
require 'regexp_property_values'
PV = RegexpPropertyValues
PV.all # => [<Value name='Alpha'>, <Value name='Blank'>, ...]
PV.all_for_current_ruby # => [<Value name='Alpha'>, <Value name='Blank'>, ...]
PV['alpha'].supported_by_current_ruby? # => true
PV['foobar'].supported_by_current_ruby? # => false
PV['AHex'].matched_characters # => %w[0 1 2 3 4 5 6 7 8 9 A B C ...]
PV['AHex'].matched_codepoints # => [48, 49, 50, ...]
PV['AHex'].matched_ranges # => [48..57, 65..70, 97..102]
# Note: #matched_characters is slow for large properties and you
# may not want to use it in time-critical code. It also omits surrogates.
PV['foobar'].matched_ranges # => RegexpPropertyValues::Error
If character_set
is installed, you can also do this:
PV['AHex'].character_set # => #<CharacterSet: {48, 49...} (size: 22)>
# get a Hash of aliases for property names
PV.alias_hash # => { <Value name='M'> => <Value name='Mark'>, ... }
# download a list of possible properties for the running Ruby version
# (only used for .all and .alias_hash, not needed for prop lookup via .[])
PV.update
FAQs
Unknown package
We found that regexp_property_values demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.