chrisvfritz / chrisvfritz/language_filter
How to escape characters?
- Dominant language
- Ruby
- Stars
- 93
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
I'm trying to exactly match some strings like "c*". Example:
```ruby
filter = LanguageFilter::Filter.new matchlist: ["c\*"]
puts filter.match?('This excerpt c* should match.')
puts filter.match?('But this c should not.')
```
I've tried the regexes `c[*]` and `c\*` (which works properly when testing them on Rubular) but they didn't work. 😕
Many thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the two LanguageFilter::Filter#match? calls in the issue, including the literal c* and c cases. Trace how the matchlist value is interpreted and determine the documented escaping needed so the first case matches while the second does not.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100