More
Regular expressions have nearly infinite depth, and this appendix has barely begun to scratch the surface, either of expressions or the ways you can use them in Ruby and Rails. A few of the things this incredibly brief guide hasnât been able to include are:
Using expressions to fragment a string into smaller pieces
Referencing earlier matches later in an expression
Creating named groups
Commenting regular expressions
A variety of special syntax forms using parentheses
Again, for a much more comprehensive guide to regular expressions, see Jeffrey E. F. Friedlâs classic Mastering Regular Expressions or Tony Stubblebineâs compact but extensive Regular Expression Pocket Reference. For more on using them specifically with Ruby, see The Ruby Programming Language, by David Flanagan and Yukihiro Matsumoto (OâReilly).
Get Learning Rails now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.