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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top