Re: Pattern based substitution

From: Daniel Mircea

How does pattern based substitution works ?

See
http://phrogz.net/ProgrammingRuby/tut_stdtypes.html#regularexpressions
particularly the section near the end of that page titled “Pattern-Based
Substitution”.

For example, how does textilize replace all occurrences of
hello world
with hello world ?

Here’s a simple example (probably not what Textilize uses):
source.gsub( /*([^*]+)*/, ‘\1’ )

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs