Sha256: b57abb52cb61ce5da59e2333beda50de807f5087e6e741bc4117845694fab373

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

#### Named Captures

This example shows a ```MatchData``` with named captures.

```show.rb```:
```ruby
require 'debug_helper'

match_data = /(?<x>.)(?<y>.)?/.match("a")
DebugHelper.show(match_data, 'My MatchData with named captures')
```

The output shows details of the ```MatchData```.

```show.yaml```:
```yaml
---
MatchData (message='My MatchData with named captures'):
  MatchData#size: 3
  MatchData#regexp: !ruby/regexp /(?<x>.)(?<y>.)?/
  MatchData#to_a:
  - a
  - a
  - 
  MatchData#captures:
  - a
  - 
  MatchData#names:
  - x
  - y
```

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debug_helper-2.1.0 markdown/readme/classes/match_data/named_captures/show.md
debug_helper-2.0.0 markdown/readme/classes/match_data/named_captures/show.md