Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

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>
Comment

PREVIOUS NEXT
Code Example
Ruby :: ruby min 2 numbers 
Ruby :: rspec add support folder to gem 
Ruby :: ruby attr_accessor multiple variables 
Ruby :: rails get source method 
Ruby :: rails excep 
Ruby :: rails logger color 
Ruby :: rails remove foreign key 
Ruby :: rails change column type string to integer 
Ruby :: length validation rails 
Ruby :: rails validate presence 
Ruby :: rails add reference 
Ruby :: array to string ruby 
Ruby :: generate csv ruby 
Ruby :: ruby generate array of alphabet 
Ruby :: ruby typeof 
Ruby :: ruby iterate over strings 
Ruby :: rails find_by 
Ruby :: run a rake task 
Ruby :: ruby while 
Ruby :: ruby includethis or that 
Ruby :: why do i ineed to reset rails server 
Ruby :: how to display the has_many in the api serializer rails 
Ruby :: ruby map 
Ruby :: sequel ruby alias table 
Ruby :: minimum of 3 elements 
Ruby :: ruby on rails multiple models pagination 
Ruby :: how to add two variables into a hash ruby 
Ruby :: grep routes rails 
Ruby :: rspec change matcher 
R :: dplyr replace na 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =