Regexp::Expression::CharacterType::Word โ A character type expression that matches word characters (\w) in regular expressions.
| Use Case | Command | Description |
|---|---|---|
| ๐ Match word characters | \w | Matches any word character (letter, digit, underscore). |
| ๐ Match non-word characters | \W | Matches any character that is not a word character. |
| ๐งช Check if a token is a word type | token.is_a?(Regexp::Expression::CharacterType::Word) | Returns true if the token represents a \w or \W type. |
| โ๏ธ Access token type | token.type | Returns :word for word character types. |
This class represents a character type token in a regular expression that matches word characters. It is part of the Regexp::Expression AST hierarchy, inheriting from Regexp::Expression::CharacterType::Base. Instances correspond to \w (positive) or \W (negative) in the applied quantifier context.
No specific options are defined for this class. All options are inherited from parent classes.
/home/chedong/.local/share/rdoc
\w and \W in Ruby regular expressionsGenerated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-28 07:20 @216.73.217.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format