A wrapper of the native StringScanner class that works correctly with multibyte character encodings. The native class deals only in bytes, not characters, for methods like [#pos] and [#matched_size]. This class deals only in characters, instead.
| Use Case | Command | Description |
|---|---|---|
| Create a new scanner | Sass::Util::MultibyteStringScanner.new(string) | Creates a new scanner for multibyte strings |
| Scan a pattern | scanner.scan(pattern) | Scans the string for the pattern and returns the matched string |
| Check a pattern | scanner.check(pattern) | Checks if the pattern matches without advancing |
| Get current character position | scanner.pos | Returns the character position (not byte) |
| Get byte size of match | scanner.byte_matched_size | Returns the byte size of the last match |
newbyte_matched_sizebyte_poscheckcheck_untilclearget_bytegetbytegetchis_a?match?matched_sizepeekpeeppointerpospos=resetrest_sizescanscan_fullscan_untilsearch_fullskipskip_untilstring=terminateunscanGenerated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-28 23:45 @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