Skip to content

Instantly share code, notes, and snippets.

@ardianta
Last active August 28, 2020 08:41
Show Gist options
  • Select an option

  • Save ardianta/5fd6a8ae277ad58a0a758b0d9546ecf5 to your computer and use it in GitHub Desktop.

Select an option

Save ardianta/5fd6a8ae277ad58a0a758b0d9546ecf5 to your computer and use it in GitHub Desktop.

Revisions

  1. ardianta renamed this gist Aug 28, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. ardianta revised this gist Jan 16, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -22,8 +22,8 @@ And the regex for replacing:
    ![$4]($3)
    ```

    - `$4` --- will take the 4th group
    - `$3` --- will take the 3rd group
    - `$4` -- will take the 4th group
    - `$3` -- will take the 3rd group

    ![VS Code Find and Replace](https://i.imgur.com/MQ91sXf.png)

  3. ardianta revised this gist Jan 16, 2020. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -10,18 +10,21 @@ And replace with:
    ![Image Caption](/img/image-name.png)
    ```

    So the regex for find:
    So the regex for finding:

    ```regex
    (\{\{<) (img) "(.*?)" "(.*?)" (>\}\})
    ```

    And the replace regex:
    And the regex for replacing:

    ```regex
    ![$4]($3)
    ```

    - `$4` --- will take the 4th group
    - `$3` --- will take the 3rd group

    ![VS Code Find and Replace](https://i.imgur.com/MQ91sXf.png)

    Demo: https://regex101.com/r/eusVXZ/2/
  4. ardianta revised this gist Jan 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,4 @@ And the replace regex:

    ![VS Code Find and Replace](https://i.imgur.com/MQ91sXf.png)

    Demo: https://regex101.com/r/eusVXZ/1
    Demo: https://regex101.com/r/eusVXZ/2/
  5. ardianta revised this gist Jan 16, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,6 @@ And the replace regex:
    ![$4]($3)
    ```

    ![VS Code Find and Replace](https://i.imgur.com/MQ91sXf.png)

    Demo: https://regex101.com/r/eusVXZ/1
  6. ardianta created this gist Jan 16, 2020.
    25 changes: 25 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    I want to find this string:

    ```markdown
    {{< img "/img/image-name.png" "Image Caption" >}}
    ```

    And replace with:

    ```markdown
    ![Image Caption](/img/image-name.png)
    ```

    So the regex for find:

    ```regex
    (\{\{<) (img) "(.*?)" "(.*?)" (>\}\})
    ```

    And the replace regex:

    ```regex
    ![$4]($3)
    ```

    Demo: https://regex101.com/r/eusVXZ/1