0

Let's say I want to match the text "something" in:

... ^something^ ...

To get everything between the ^, I can do:

However, is there a way to use a character class to get every character except ^, the negation character? For example, something like:

  • \^([^^])\^

What would be the proper way to escape [^^] ?

David542
  • 101,766
  • 154
  • 423
  • 727
  • `[^^]` matches any char but `^`. `[^^]*` matches any 0+ chars other than `^` – Wiktor Stribiżew May 23 '20 at 23:03
  • 1
    `[^^]` needs no escaping. `^` has only a special meaning if it is the first character of a character set. If it appear again in the set, its just an ordinary characters. – Mecki May 23 '20 at 23:42

0 Answers0