FAQ Database Discussion Community


Regex searching for time doesn't want to be non-greedy

regex,quantifiers,non-greedy,spiceworks
I'm trying to run a regex in Spiceworks to parse through email headers to select the first instance of time for ticket assignment purposes. The regex itself works, but it picks up all instances of time rather than just one. Here's the regex: \.*(0[1]|1[3-7]):\d\d:\d\d I've tried to make in non-greedy...

universal and existential quantifier in prolog

prolog,universal,existential-type,quantifiers
How can I implement following rules in prolog. I write the “ No spiders are mammals” sentence as Existential and universal: ¬∃x(mammals(X) ∧ spider(X) ) //It is not the case that mammals are spider ∀X(mammals(X) ⇒ ¬spider(X)) //All mammals are non-spider. ...

Quantifier to print only three digit numbers in a Java regular expression

java,regex,quantifiers
What is the quantifier to print only three digit numbers in a string in Java regular expressions? Input : 232,60,121,600,1980 Output : 232,121,600 Instead my output is coming as: Output : 232,121,600,198 I am using (\\d{3}). What quantifier should I use in order to print only three digit numbers?...