format_sed_syntax.qbk 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [/
  2. Copyright 2006-2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:sed_format Sed Format String Syntax]
  8. Sed-style format strings treat all characters as literals except:
  9. [table
  10. [[character][description]]
  11. [[&][The ampersand character is replaced in the output stream by
  12. the whole of what matched the regular expression. Use
  13. \\& to output a literal '&' character.]]
  14. [[\\][Specifies an escape sequence.]]
  15. ]
  16. An escape character followed by any character x, outputs that character unless x
  17. is one of the escape sequences shown below.
  18. [table
  19. [[Escape][Meaning]]
  20. [[\\a][Outputs the bell character: '\\a'.]]
  21. [[\\e][Outputs the ANSI escape character (code point 27).]]
  22. [[\\f][Outputs a form feed character: '\\f']]
  23. [[\\n][Outputs a newline character: '\\n'.]]
  24. [[\\r][Outputs a carriage return character: '\\r'.]]
  25. [[\\t][Outputs a tab character: '\\t'.]]
  26. [[\\v][Outputs a vertical tab character: '\\v'.]]
  27. [[\\xDD][Outputs the character whose hexadecimal code point is 0xDD]]
  28. [[\\x{DDDD}][Outputs the character whose hexadecimal code point is 0xDDDDD]]
  29. [[\\cX][Outputs the ANSI escape sequence "escape-X".]]
  30. [[\\D][If D is a decimal digit in the range 1-9, then outputs the text that matched sub-expression D.]]
  31. ]
  32. [endsect]