View source code
							
							
						
								Display the source code in std/regex.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Struct std.regex.Captures
Captures object contains submatches captured during a call
    to match or iteration over RegexMatch range.
						
				struct Captures(R)
				
				  
				
				if (isSomeString!R);
						
					
				First element of range is the whole match.
Properties
| Name | Type | Description | 
|---|---|---|
| back[get] | R | Range interface. | 
| captures[get] | auto | A hook for compatibility with original std.regex. | 
| empty[get] | bool | Range interface. | 
| front[get] | R | Range interface. | 
| hit[get] | R | Slice of matched portion of input. | 
| length[get] | size_t | Number of matches in this object. | 
| post[get] | R | Slice of input immediately after the match. | 
| pre[get] | R | Slice of input prior to the match. | 
| whichPattern[get] | int | Number of pattern matched counting, where 1 - the first pattern. Returns 0 on no match. | 
Methods
| Name | Description | 
|---|---|
| opCast() | Explicit cast to bool. Useful as a shorthand for !(x.empty) in if and assert statements. | 
| opIndex(i) | Range interface. | 
| opIndex(i) | Lookup named submatch. | 
| popBack() | Range interface. | 
| popFront() | Range interface. | 
Example
import stdAuthors
Dmitry Olshansky,
    API and utility constructs are modeled after the original std
  by Walter Bright and Andrei Alexandrescu.
License
					Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.