Skip to content

Commit

Permalink
Small fixes after update from Herb.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxSagebaum committed Aug 6, 2024
1 parent 57a2bd0 commit e90034e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/cpp2/metafunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ A `regex` type has data members that are regular expression objects. This metafu
name_matcher: @regex type
= {
regex := R"((\w+) (\w+))"; // for example: Margaret Hamilton
regex_no_case := R"(/(ab)+/i)";
regex_no_case := R"(/(ab)+/i)"; // case insensitive match of `ab`
}

main: (args) = {
Expand All @@ -382,7 +382,7 @@ main: (args) = {
data = args[1];
}

// regex.match requires matches to start at the beginning the target string
// regex.match requires matches to match the entire string, from start to end
result := m.regex.match(data);
if result.matched {
// We found a match; reverse the order of the substrings
Expand All @@ -406,7 +406,7 @@ The `@regex` metafunction currently supports most of [Perl regex syntax](https:/
Each regex object has the type `cpp2::regex::regular_expression`, which is defined in `include/cpp2regex.h2`. The member functions are:

``` cpp title="Member functions for regular expressions"
// .match() requires matches to start at the beginning the target string
// .match() requires matches to match the entire string, from start to end
// .search() finds a match anywhere within the target string

match : (this, str: std::string_view) -> search_return;
Expand Down
2 changes: 1 addition & 1 deletion docs/notes/regex_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The listings are taken from the [Perl regex docs](https://perldoc.perl.org/perlr
| **`\r`** | Return (CR) | <span style="color:green">Supported</span> |
| **`\f`** | Form feed (FF) | <span style="color:green">Supported</span> |
| **`\a`** | Alarm (bell) (BEL) | <span style="color:green">Supported</span> |
| **`\3`** | Escape (think troff) (ESC) | <span style="color:green">Supported</span> |
| **`\e`** | Escape (think troff) (ESC) | <span style="color:green">Supported</span> |
| **`\x{}`, `\x00`** | Character whose ordinal is the given hexadecimal number | <span style="color:green">Supported</span> |
| **`\o{}`, `\000`** | Character whose ordinal is the given octal number | <span style="color:green">Supported</span> |

Expand Down

0 comments on commit e90034e

Please sign in to comment.