Guest User

Untitled

a guest
Nov 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. By example, I wanted to replace all inline math $...$ with \( ... \). So I had to match the (escaped) dollar sign \$ then put the text inbetween in a group (this is achieved by the parentheses). The brackets, in usual regex style, form a category of symbols. In this case every symbol but the dollar sign in order to simulate non-greedy matching. This is like using .+? in normal regular expressions. So the search pattern is:
  2.  
  3. \$([^\$]+)\$
  4.  
  5. The group given by the parentheses can be referred to in the replacement by \1, so the replacement text is:
  6.  
  7. \\( \1 \\)
Add Comment
Please, Sign In to add comment