Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Regular Express - match all char but pattern at the end of line
  2. Hello, World! [strip this]
  3.        
  4. Hello, World!
  5.        
  6. Hello, [cold] World! [strip this]
  7.        
  8. Hello, [cold] World!
  9.        
  10. fge@erwin ~ $ perl -ne 's,s*[[^]]+]s*$,,; print "Result: -->$_<--n"'
  11. Hello, World! [strip this]
  12. Result: -->Hello, World!<--
  13. Hello, [cold] World! [strip this]
  14. Result: -->Hello, [cold] World!<--
  15. fge@erwin ~ $
  16.        
  17. (.*)(s*[.*])