Convert full image paths to relative with regex

See here for the original answer.

One way to accomplish this is by looking for the last occurrence of the backslash character, since your examples indicated that the presence of at least once can be relied on.

The find regex:

(href|src)=".*\\(.*)"

The replace regex:

$1="images\\$2"

You can see this in action here with the examples you have provided.


Tags

  1. regex (Private)
  2. stack-overflow (Private)
  3. answer (Private)