Answers for "ruby regex non greedy"

0

ruby non greedy regex

the "?" makes the regex non greedy:

Example 2: Non-Greedy:
Regex: <h[0-9]>.*?</h[0-9]>
Input: <h3>My Title</h3>
<h[0-9]> matches: <h3>
.*? matches: My Title
</h[0-9]> matches: </h3>
Posted by: Guest on February-08-2021

Browse Popular Code Answers by Language