Reputation: 4941
I've faces with the next one regular expression: "^.*\\(?:some\\).*$"
.
I've understand ^
and $
and \\(
with \\)
for back-referencing.
But what is the ?:some
construction?
Upvotes: 2
Views: 73
Reputation: 92986
A group starting with ?:
is a non capturing group, means there will be no backreference, the some
would be your search word.
^
is an anchor to match the start of the line
$
is an anchor to match the end of the line
Your expression would match e.g.
Foobar some more text
Foobar somemore text
some
Upvotes: 3