"Fossies" - the Fresh Open Source Software Archive
Member "muscle/html/muscle-by-example/docs/stringmatcher.md" (28 Nov 2019, 2148 Bytes) of package /linux/privat/muscle7.52.zip:
As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format).
Alternatively you can here view
the uninterpreted source code file.
A member file download can also be achieved by clicking within a package contents listing on the according byte size field.
muscle::StringMatcher class (API)
Holds a pattern-string (ASCII or UTF-8) that represents a bash-shell-style wildcard/globbing-pattern, and uses it to do pattern-matching.
- StringMatcher::Match(const char *) returns true iff the pattern-string matches the passed-in string.
- Similar to: QRegularExpression, std::regex_match
- For example, glob-pattern
str* will match “string” and “strap” but not “ring” or “trap”.
- Supported “traditional” wildcard-characters include
- Syntax extension: a glob-pattern starting with
~ will match only strings that don’t match the rest of the pattern (e.g.
~j* will match all strings that don’t start with “j”)
- Syntax extension: a glob-pattern like
<3-5,10-12,20-> will match strings that represent integers in the specified range(s) (e.g. “3”, “4”, “5”, “10”, “11”, and “12”, plus “20” and higher)
- StringMatcher can also be used to match against standard regex-patterns, if the simplified bash-shell-style globbing-syntax isn’t sufficient. (pass in
false as the second constructor-argument to enable full-regex mode)
Try compiling and running the mini-example-programs in
make to compile example_*, and then run each from Terminal while looking at the corresponding .cpp file)
Quick links to source code of relevant MUSCLE-by-example programs: