🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

gitbook-plugin-jazer2

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-jazer2

Gitbook exercises validated through a XRegExp (work in progress)

latest
Source
npmnpm
Version
1.0.27
Version published
Weekly downloads
0
-100%
Maintainers
2
Weekly downloads
 
Created
Source

Gitbook-Plugin-Jazer - REGEXP

Pagina Principal

Warning! This is a test version.

This is work in development. Use it at your own risk.

Que es

Este es un plugin de ejemplo para gitbook en el que se permite realizar ejercicios cuya respuesta se valida mediante una expresión regular (Usando XRegExp)

Install

To use the jazer2 plugin in your Gitbook project, add the jazer2 plugin to the book.json file, then install plugins using gitbook install.

{
    "plugins": ["jazer2"]
}

Ejemplo Simple

{% regexp %}
¿Quien descubrió America?
{% solution %}
Cristobal Colon
{% validation %}
/\s*(Crist[oó]bal\s+)?Col[oó]n\s*/i
{% endregexp %}

Ejemplo con XRegExp:

Es posible usar XRegExp:

{% regexp %}
¿Quienes reinaban en España cuando se descubrió America?
{% solution %}
Los Reyes Católicos
{% validation %}
/
  (Isabel\s+                    # nombre sencillo
  ((I\s+)?de\s+Castilla\s+)?    # titulo de Isabel
  y
  \s+Fernando                   # nombre sencillo
  (\s+(II\s+)?de\s+Arag[oó]n)?) # titulo de Fernando
|
  (Reyes\s+Cat[oó]licos)  # conocidos también por este nombre
/ix
{% endregexp %}

Errores en la XRegExp

En el caso de que la XRegExp contenga errores se abre una ventana de alerta.

En la siguiente expresión regular el paréntesis abrir no tiene matching paréntesis cerrar:

{% regexp %}
¿Quienes reinaban en España cuando se descubrió America?
{% solution %}
Los Reyes Católicos
{% validation %}
/
  (Isabel\s+                    # paréntesis abrir
  y
  \s+Fernando                   # sin
|
  Reyes\s+Cat[oó]licos          # paréntesis cerrar
/ix
{% endregexp %}

Al ser procesado el plugin emite un alert con el mensaje de error: error message: bad regexp

FAQs

Package last updated on 24 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts