Skip to content

Commit

Permalink
Merge pull request #20 from pscls/patch-3
Browse files Browse the repository at this point in the history
Update regexp-matches.md
  • Loading branch information
arushi-firebolt authored Jan 18, 2024
2 parents 172318b + 8b2d59c commit d9abb64
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SELECT
SELECT
REGEXP_MATCHES('Learning about #REGEX in #Firebolt 2023', '#([A-Za-z]+) (\\d+)');
```
**Returns**: `["Firebolt", "2023"]`
**Returns**: `["Firebolt"]`

## Example–using flags

Expand All @@ -62,7 +62,7 @@ SELECT
REGEXP_MATCHES('aPPLePie', '([A-Z]+)', 'U');
```

**Returns**: `["P","P","L","P"]`
**Returns**: `["P"]`

The `s` flag causes that the `.` metacharacter in regex matches the newline character `\n` in addition to any character. This flag is enabled per default and without the disablement by `-s`, this query would return `["Hello\nWorld"]`.

Expand All @@ -71,4 +71,4 @@ SELECT
REGEXP_MATCHES('Hello\nWorld', '.*', '-s');
```

**Returns**: `["Hello"]`
**Returns**: `["Hello"]`

0 comments on commit d9abb64

Please sign in to comment.