Jump to content

Ruby regular expressions

From EggeWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Comments are one of the great, yet little used, features of modern regular expression engines. Consider the following:

<geshi lang="ruby"> "Ruby is fun" =~ /(?#a)r(?#e you able to )u(?#nderstand what this )b(?#eautiful, yet sill)y(?# regular expression will match?)/i </geshi>