Stumbler
Stumbler

Reputation: 2146

regex pattern between brackets

Trying to find a pattern that matches

(see ...)

Where the ellipses may be anything.

As far as I can see the regular expression should be

\(see*\)

Although

\(see

Will match the beginning of the pattern, the rest does not work. Is this to do with the space between "see" and the other characters?

Upvotes: 0

Views: 72

Answers (2)

femtoRgon
femtoRgon

Reputation: 33351

No, generally in regexes, * means 0 or more of the preceding character, so see* matches "see" and "seee" and "seeeeeeeeeeeeeeeeee". . matches any character, so .* is the usual way to match a bunch of unknown characters, such as:

\(see.*\)

Upvotes: 3

Matthew Warman
Matthew Warman

Reputation: 3442

You are missing a dot from your regular expression:

\(see.*\)

Upvotes: 3

Related Questions