Skip to content

Instantly share code, notes, and snippets.

@walish
Last active July 16, 2018 08:14
Show Gist options
  • Save walish/e8430d21dbf0dbcafdb1bb9a87b3a783 to your computer and use it in GitHub Desktop.
Save walish/e8430d21dbf0dbcafdb1bb9a87b3a783 to your computer and use it in GitHub Desktop.

Revisions

  1. walish revised this gist Jul 16, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions regex-101.md
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,8 @@ Find string
    Substitution
    ```
    <!-- ko i18n: '$1'--><!-- /ko --> //<!-- ko i18n: '必須'--><!-- /ko -->
    ```
    * **Trim unicode/UTF-8 whitespace in PHP**
    ```
    preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string);
    ```
  2. walish revised this gist Jun 29, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion regex-101.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    * **Replace wrappers around strings**
    ```
    Find string
    ```
    <\?= __\('(.*)?'\) \?> // <?= __('必須') ?>
    ```
    Substitution
    ```
    <!-- ko i18n: '$1'--><!-- /ko --> //<!-- ko i18n: '必須'--><!-- /ko -->
    ```
  3. walish created this gist Jun 29, 2018.
    7 changes: 7 additions & 0 deletions regex-101.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    * **Replace wrappers around strings**
    ```
    Find string
    <\?= __\('(.*)?'\) \?> // <?= __('必須') ?>
    Substitution
    <!-- ko i18n: '$1'--><!-- /ko --> //<!-- ko i18n: '必須'--><!-- /ko -->
    ```