Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = 'The only true (wisdom) is in knowing you know (nothing)'
- s.match(/(([^)]+))$/).captures
- s = 'The only true (wisdom) is in knowing you know (nothing)'
- s.match(/(?<=()([^)]+)(?=)$)/).captures
- str = "The only true (wisdom) is in knowing you know (nothing)"
- str.scan(/((.+?))/).last
- #=> "nothing"
- s = 'The only true (wisdom) is in knowing you know (nothing)'
- s.match(/(([^)]+))$/).captures # => ["nothing"]
- "...knowing you know ((almost) nothing)"[/(((?:[^()]*|(g<1>))*))$/, 1]
- #=> "(almost) nothing"
- s = 'The only true (wisdom) is in knowing you know (nothing)'
- r = s.reverse
- r[(r.index(')') + 1)...(r.index('('))].reverse
- #=> "nothing"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement