0

From this string:

... Descriere: hauser - un motor ars , in urma reviziei 
anuale echipa sosita in statie a constatat ca unul din 
hausere functioneaza cu un singur motor . </p> Alte... <p>
Reparare efectuat... </p>

I need to get the string between Descriere: and the first occurrence of the </p> string.
I tried: (Descriere: )(.*)(<\/p>) but it gets the entire string, not stopping at first delimiter.

2 Answers 2

2

You need a non-greedy quantifier (.*?: note the last ?). This will capture as few characters as possible.

Sign up to request clarification or add additional context in comments.

Comments

1

Make it non-greedy by adding a quantifier should work :

(Descriere: )(.*?)(<\/p>)

or

(Descriere: )(.*+)(<\/p>)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.