Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Pattern based substitution
Gavin Kistner
10/16/2006 5:29:00 PM
From: Daniel Mircea
> How does pattern based substitution works ?
See
http://phrogz.net/ProgrammingRuby/tut_stdtypes.html#regulare...
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 <strong>hello world</strong> ?
Here's a simple example (probably not what Textilize uses):
source.gsub( /\*([^*]+)\*/, '<strong>\\1</strong>' )
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Pattern based substitution
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password