re = /((\bprostat)(?=\w{0,3}\b))/m
str = '/*ITALIAN*/
Neoformazione del palato duro in paziente affetto da ca della prostata.
Frustoli agoboptici di parenchima prostatico.
Il complesso dei reperti orienta in prima ipotesi per localizzazione di carcinoma di origine prostatica.
Agobiopsie prostatiche multiple
Ipertrofia prostatica.
/*ENGLISH*/
New formation of the hard palate in a patient affected by prostate cancer.
Fragments showing hypertrophic prostate parenchyma.
The combination of findings suggests a preliminary diagnosis of prostate-origin carcinoma.
Multiple prostatic core biopsies.
Prostatic hypertrophy.'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html