Regular expressions: finding one occurence

  • Thread starter Thread starter Peter Thornqvist
  • Start date Start date
P

Peter Thornqvist

How would I design a regular expression to find the first occurence of a
specific pattern and not look for more matches?
 
Just to clarify, I can't use the {n} quantifier since this doesn't prevent
Regex from parsing the entire string even if a match has been found. Is
there any other way to accomplish what I want, i.e just find the first
occurence and then stop?
 
Back
Top