Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
8.9 KiB

  1. <template>
  2. <div id="references" class="references">
  3. <div class="reference">
  4. <h3 class="title mb">Metacharacters</h3>
  5. <h4 class="caption mb">Metacharacters express sets of characters or special characters.</h4>
  6. <ul class="characters">
  7. <li class="character mb">
  8. <p class="character__code">
  9. <span class="purple">.</span>
  10. </p>
  11. <p class="character__info">
  12. <span>any character</span>
  13. </p>
  14. </li>
  15. <li class="character">
  16. <p class="character__code">
  17. <span>^</span>
  18. </p>
  19. <p class="character__info">
  20. <span>beginning of a line</span>
  21. </p>
  22. </li>
  23. <li class="character">
  24. <p class="character__code">
  25. <span>$</span>
  26. </p>
  27. <p class="character__info">
  28. <span>end of a line</span>
  29. </p>
  30. </li>
  31. <li class="character">
  32. <p class="character__code">
  33. <span>\</span>
  34. </p>
  35. <p class="character__info">
  36. <span>quotes special characters <br>(
  37. <span class="purple">* ? + [ ] ( ) { } ^ $ | \ . /</span> )
  38. </span>
  39. </p>
  40. </li>
  41. <li class="character">
  42. <p class="character__code">
  43. <span class="blue">\w</span>
  44. </p>
  45. <p class="character__info">
  46. <span>word</span>
  47. </p>
  48. </li>
  49. <li class="character">
  50. <p class="character__code">
  51. <span class="blue">\t</span>
  52. </p>
  53. <p class="character__info">
  54. <span>horizontal tabulation</span>
  55. </p>
  56. </li>
  57. <li class="character">
  58. <p class="character__code">
  59. <span class="blue">\n</span>
  60. </p>
  61. <p class="character__info">
  62. <span>new line</span>
  63. </p>
  64. </li>
  65. <li class="character">
  66. <p class="character__code">
  67. <span class="blue">\d</span>
  68. </p>
  69. <p class="character__info">
  70. <span>any digit</span>
  71. </p>
  72. </li>
  73. <li class="character">
  74. <p class="character__code">
  75. <span class="blue">\t</span>
  76. </p>
  77. <p class="character__info">
  78. <span>white space character (
  79. <span class="blue">\t \n \f \r \{Z}</span>)</span>
  80. </p>
  81. </li>
  82. <li class="character">
  83. <p class="character__code">
  84. <span class="blue">[...]</span>
  85. </p>
  86. <p class="character__info">
  87. <span>match any character (or range of characters) inside the bracket. Range may be e.g.
  88. <span class="blue">[a-z], [A-Z], [3...5]</span>, etc.</span>
  89. </p>
  90. </li>
  91. <li class="character">
  92. <p class="character__code">
  93. <span class="blue">\D</span>
  94. </p>
  95. <p class="character__info">
  96. <span>any character that is not a decimal digit</span>
  97. </p>
  98. </li>
  99. <li class="character">
  100. <p class="character__code">
  101. <span class="blue">\S</span>
  102. </p>
  103. <p class="character__info">
  104. <span>non-whitespace character</span>
  105. </p>
  106. </li>
  107. <li class="character">
  108. <p class="character__code">
  109. <span class="blue">\W</span>
  110. </p>
  111. <p class="character__info">
  112. <span>non-word character</span>
  113. </p>
  114. </li>
  115. </ul>
  116. </div>
  117. <div class="reference">
  118. <h3 class="title mb">Operators</h3>
  119. <h4 class="caption mb">Operators allow to desribe how an expression (or subexpression) should be matched.</h4>
  120. <ul class="characters">
  121. <li class="character mb">
  122. <p class="character__code">
  123. <span>(
  124. <span class="white"></span>)</span>
  125. </p>
  126. <p class="character__info">
  127. <span>groups expression into subexpressions</span>
  128. </p>
  129. </li>
  130. <li class="character mb">
  131. <p class="character__code">
  132. <span class="white">A
  133. <span class="purple">|</span> B</span>
  134. </p>
  135. <p class="character__info">
  136. <span>groups expression into subexpressions</span>
  137. </p>
  138. </li>
  139. <li class="character mb">
  140. <p class="character__code">
  141. <span class="purple">^</span>
  142. </p>
  143. <p class="character__info">
  144. <span>negation</span>
  145. </p>
  146. </li>
  147. <li class="character mb">
  148. <p class="character__code">
  149. <span class="purple">*</span>
  150. </p>
  151. <p class="character__info">
  152. <span>match 0 or more times</span>
  153. </p>
  154. </li>
  155. <li class="character mb">
  156. <p class="character__code">
  157. <span class="purple">+</span>
  158. </p>
  159. <p class="character__info">
  160. <span>match 1 or more times</span>
  161. </p>
  162. </li>
  163. <li class="character mb">
  164. <p class="character__code">
  165. <span class="purple">?</span>
  166. </p>
  167. <p class="character__info">
  168. <span>match 0 or 1 time</span>
  169. </p>
  170. </li>
  171. <li class="character mb">
  172. <p class="character__code">
  173. <span class="purple">{
  174. <span class="white">n</span> }</span>
  175. </p>
  176. <p class="character__info">
  177. <span>match exactly n times</span>
  178. </p>
  179. </li>
  180. <li class="character mb">
  181. <p class="character__code">
  182. <span class="purple">{
  183. <span class="white">n
  184. <span class="purple">,</span> m</span> }</span>
  185. </p>
  186. <p class="character__info">
  187. <span>match exactly n times</span>
  188. </p>
  189. </li>
  190. </ul>
  191. </div>
  192. <div class="reference">
  193. <h3 class="title mb">Non-capturing operators</h3>
  194. <h4 class="caption mb">These operators work by one simple rule. They are not captured in groups.</h4>
  195. <ul class="characters">
  196. <li class="character mb">
  197. <p class="character__code">
  198. <span class="disabled">( ? # ... )</span>
  199. </p>
  200. <p class="character__info">
  201. <span>comment</span>
  202. </p>
  203. </li>
  204. <li class="character mb">
  205. <p class="character__code">
  206. <span class="purple">( ? :
  207. <span class="white"></span> )</span>
  208. </p>
  209. <p class="character__info">
  210. <span>Subexpression must occur but it's not captured in group.</span>
  211. </p>
  212. </li>
  213. <li class="character mb">
  214. <p class="character__code">
  215. <span class="purple">( ? !
  216. <span class="white"></span> )</span>
  217. </p>
  218. <p class="character__info">
  219. <span>Makes sure that the subexpression does not occur at current position. It's useful to exclude part of expression.</span>
  220. </p>
  221. </li>
  222. </ul>
  223. </div>
  224. </div>
  225. </template>