createLineRegExp()function

createLineRegExp(pattern: NamedRegExp<T>, start?: PossibleRegExp, end?: PossibleRegExp): T extends NamedRegExpData ? NamedRegExp<T> : RegExp
createLineRegExp(pattern: PossibleRegExp, start?: PossibleRegExp, end?: PossibleRegExp): T extends NamedRegExpData ? NamedRegExp<T> : RegExp
ParamType
patternNamedRegExp<T>
The content pattern to match between the boundaries (a NamedRegExp to type the captured data). required
startPossibleRegExp
The leading boundary pattern (defaults to LINE_START_REGEXP).
endPossibleRegExp
The trailing boundary pattern (defaults to LINE_END_REGEXP).
patternPossibleRegExp
Things that can be converted to a regular expression. required
startPossibleRegExp
Things that can be converted to a regular expression.
endPossibleRegExp
Things that can be converted to a regular expression.
Return
T extends NamedRegExpData ? NamedRegExp<T> : RegExp
A RegExp (a NamedRegExp<T> when the content pattern names its capture groups).
T extends NamedRegExpData ? NamedRegExp<T> : RegExp

Create a RegExp that matches a single line of content, wrapped between line-start and line-end boundaries.

Factory for RegExp.

Examples

createLineRegExp("(?<prefix>#{1,6})")