Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java 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.
 
You can't expect to wield supreme executive power just because
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!