Package dev.yasint.regexsynth.ast
Class Groups
java.lang.Object
dev.yasint.regexsynth.ast.Groups
public final class Groups
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Groups() -
Method Summary
Modifier and Type Method Description static ExpressioncaptureGroup(Expression... expressions)Creates a capturing group.static ExpressionnamedCaptureGroup(java.lang.String name, Expression... expressions)Creates a named capturing group.static ExpressionnonCaptureGroup(Expression... expressions)Creates a non capturing group.
-
Constructor Details
-
Groups
public Groups()
-
-
Method Details
-
nonCaptureGroup
Creates a non capturing group. You can use this to group and to avoid unnecessary capturing, and the match process will be more efficient. As the name implies it will not include in the final result.- Parameters:
expressions- sub-expression of this group- Returns:
- non-capturing group.
-
captureGroup
Creates a capturing group. By using this you can group that part of the regular expression together. This allows you to apply a quantifier to a entire group or to restrict alternation to part of the regex.- Parameters:
expressions- sub-expressions of this group- Returns:
- capturing group
-
namedCaptureGroup
Creates a named capturing group. This is very much like the capturing group. it allows you to specify a capture group in the matched result. But also with a name to the group(?P<name>...)- Parameters:
name- name of this capturing groupexpressions- sub-expressions of this group- Returns:
- named capturing group
-