Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

(.*?) regex  RSS feed

 
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
What does this regex mean ?
(.*?)
. means any charachter.
* means zero or more.
? means zero or one.
.* means zero or more of any charachters, but what about ? after them ?
thanks.
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "?" behind a quantifier (such as "*") changes it from greedy to reluctant. A greedy quantifier will always try to find the maximum match, whereas a reluctant one finds the minimum one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!