Skip to content

Instantly share code, notes, and snippets.

@jaimeivan
Last active August 29, 2015 14:01
Show Gist options
  • Save jaimeivan/6cfa831be6482b88c6a0 to your computer and use it in GitHub Desktop.
Save jaimeivan/6cfa831be6482b88c6a0 to your computer and use it in GitHub Desktop.

Revisions

  1. jaimeivan revised this gist May 7, 2014. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions anchor.with.name.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    Busca los `<a>` que NO tengan la propiedad `name` y que no tengan ningún contenido
    ___

    De éstos:
    ```html
    <input name="2013" id="2013"></input>
    <a href="http://your.site.com"></a>
    <a href="http://your.site.com">sdsfs</a>
    <a name="2013" id="2013"></a>
    <a id="2013" name="2013"></a>
    ```
    Encuentra éste:
    ```html
    <a href="http://your.site.com"></a>
    ```

    **regex**:
    ```
    (?!.*(name))<a.*><\/a>
    ```
  2. jaimeivan revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onclick.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Busca todo lo que tenga onclick
    Busca todo lo que tenga `onclick`
    ___

    ```html
  3. jaimeivan revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onclick.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Busca todo lo que tenga onclick
    ---
    ___

    ```html
    <a onclick="window.open(this.href,'options','scrollbars=yes,resizable=yes,width=720,height=400'); return false" href="http://your.site.com" />
  4. jaimeivan revised this gist May 7, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion MM_openBrWindow.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Busca lo que tenga en el `href` el script de *Dream Weaver* `MM_openBrWindow` y sólo deja el url
    ---
    ____

    De:
    ```html
    @@ -11,6 +11,7 @@ a:
    ```

    **regex**:

    Find What:
    ```
    javascript:MM_openBrWindow\('([a-z/A-Z\-0-9.]*),?.*\)
  5. jaimeivan revised this gist May 7, 2014. 2 changed files with 4 additions and 2 deletions.
    3 changes: 2 additions & 1 deletion MM_openBrWindow,md → MM_openBrWindow.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #Busca lo que tenga en el `href` el script de *Dream Weaver* `MM_openBrWindow` y sólo deja el url
    Busca lo que tenga en el `href` el script de *Dream Weaver* `MM_openBrWindow` y sólo deja el url
    ---

    De:
    ```html
    3 changes: 2 additions & 1 deletion onclick.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #Busca todo lo que tenga onclick
    Busca todo lo que tenga onclick
    ---

    ```html
    <a onclick="window.open(this.href,'options','scrollbars=yes,resizable=yes,width=720,height=400'); return false" href="http://your.site.com" />
  6. jaimeivan revised this gist May 7, 2014. 2 changed files with 23 additions and 1 deletion.
    21 changes: 21 additions & 0 deletions MM_openBrWindow,md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #Busca lo que tenga en el `href` el script de *Dream Weaver* `MM_openBrWindow` y sólo deja el url

    De:
    ```html
    <a href="javascript:MM_openBrWindow('http://your.site.com','nueva-vetana','scrollbars=yes,resizable=yes,width=720,height=400')">Tu sitio .com</a>
    ```
    a:
    ```html
    <a href="http://your.site.com">Tu sitio .com</a>
    ```

    **regex**:
    Find What:
    ```
    javascript:MM_openBrWindow\('([a-z/A-Z\-0-9.]*),?.*\)
    ```

    Replace With:
    ```
    $1
    ```
    3 changes: 2 additions & 1 deletion onclick.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    Busca todo lo que tenga onclick
    #Busca todo lo que tenga onclick

    ```html
    <a onclick="window.open(this.href,'options','scrollbars=yes,resizable=yes,width=720,height=400'); return false" href="http://your.site.com" />
    ```

    **regex**:
    ```
    onclick=\".*?\"
    ```
  7. jaimeivan revised this gist May 7, 2014. 2 changed files with 9 additions and 3 deletions.
    9 changes: 9 additions & 0 deletions onclick.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    Busca todo lo que tenga onclick

    ```html
    <a onclick="window.open(this.href,'options','scrollbars=yes,resizable=yes,width=720,height=400'); return false" href="http://your.site.com" />
    ```

    ```
    onclick=\".*?\"
    ```
    3 changes: 0 additions & 3 deletions regex.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    ```
    onclick=\".*?\"
    ```
  8. jaimeivan revised this gist May 7, 2014. 2 changed files with 0 additions and 15 deletions.
    File renamed without changes.
    15 changes: 0 additions & 15 deletions regex2
    Original file line number Diff line number Diff line change
    @@ -1,15 +0,0 @@
    1. Plain Strings (207): `foo`
    2. Anchors (208): `k$`
    3. Ranges (202): `^[a-f]*$`
    4. Backrefs (201): `(...).*\1`
    5. Abba (169): `^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef`
    6. A man, a plan (177): `^(.)[^p].*\1$`
    7. Prime (286): `^(?!(..+)\1+$)`
    8. Four (199): `(.)(.\1){3}`
    9. Order (198): `^[^o].....?$`
    10. Triples (507): `(^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)`
    11. Glob (364): `^((\*(er|f|i|p|t|v))|(b|c(h|o|r)|do|l|mi|p(a|r|u)|re|w))`
    12. Balance (286): `^(<(<(<(<(<(<<>>)*>)*>)*>)*>)*>)*$`
    13. Powers (56): `^((((((((((x)\10?)\9?)\8?)\7?)\6?)\5?)\4?)\3?)\2?)\1?$`

    Total Score: 3060
  9. jaimeivan revised this gist May 7, 2014. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions regex2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    1. Plain Strings (207): `foo`
    2. Anchors (208): `k$`
    3. Ranges (202): `^[a-f]*$`
    4. Backrefs (201): `(...).*\1`
    5. Abba (169): `^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef`
    6. A man, a plan (177): `^(.)[^p].*\1$`
    7. Prime (286): `^(?!(..+)\1+$)`
    8. Four (199): `(.)(.\1){3}`
    9. Order (198): `^[^o].....?$`
    10. Triples (507): `(^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)`
    11. Glob (364): `^((\*(er|f|i|p|t|v))|(b|c(h|o|r)|do|l|mi|p(a|r|u)|re|w))`
    12. Balance (286): `^(<(<(<(<(<(<<>>)*>)*>)*>)*>)*>)*$`
    13. Powers (56): `^((((((((((x)\10?)\9?)\8?)\7?)\6?)\5?)\4?)\3?)\2?)\1?$`

    Total Score: 3060
  10. jaimeivan revised this gist May 7, 2014. 1 changed file with 1 addition and 7 deletions.
    8 changes: 1 addition & 7 deletions regex
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,3 @@
    ```
    onclick=\".*?\"
    ````

    /* Reemplaza el contenido la url de MM_openBrWindow */
    <a href="javascript:MM_openBrWindow('/documentos/CONS-GEN/actas/2003/ao280103.pdf','ventana1','scrollbars=yes,resizable=yes,width=720,height=400')">28 de enero</a>

    Find What: javascript:MM_openBrWindow\('([a-z/A-Z\-0-9.]*),?.*\)
    Replace With: $1
    ```
  11. jaimeivan revised this gist May 7, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion regex
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    ```
    onclick=\".*?\"
    ````
  12. jaimeivan revised this gist May 7, 2014. 1 changed file with 10 additions and 2 deletions.
    12 changes: 10 additions & 2 deletions regex
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,10 @@
    //Quita el onclick
    onclick=\".*?\"

    ```
    onclick=\".*?\"
    ````

    /* Reemplaza el contenido la url de MM_openBrWindow */
    <a href="javascript:MM_openBrWindow('/documentos/CONS-GEN/actas/2003/ao280103.pdf','ventana1','scrollbars=yes,resizable=yes,width=720,height=400')">28 de enero</a>

    Find What: javascript:MM_openBrWindow\('([a-z/A-Z\-0-9.]*),?.*\)
    Replace With: $1
  13. jaimeivan renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  14. jaimeivan created this gist May 7, 2014.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    //Quita el onclick
    onclick=\".*?\"