Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > pre_match and post_match for subexpressions

Thread Tools

pre_match and post_match for subexpressions

trans. (T. Onoma)
Posts: n/a

md = /(X)(Y)(Z)/.match "<<<XYZ>>>"

md.pre_match(2) #=> "<<<X"
md.post_match(2) #=> "Z>>>"


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby 1.9 bug, no copy-on-write for MatchData#post_match Paolo Bonzini Ruby 0 02-06-2008 02:32 PM
Re: subexpressions (OT: math) Steve Howell Python 23 06-04-2007 11:49 AM
subexpressions Sergey Dorofeev Python 20 06-04-2007 12:35 AM
Re: subexpressions Steve Howell Python 2 06-02-2007 02:39 PM
Examples of using "reluctant" subexpressions in regexps? Java 4 04-27-2005 07:46 PM