You are here

public static property Pinterest::$validationRegexp in Media entity Pinterest 8.2

List of validation regular expressions.

possible hostnames: www.pinterest.com, pinterest.com, jp.pinterest.com, pinterest.jp, pinterest.co.uk

Type: array

File

src/Plugin/media/Source/Pinterest.php, line 36

Class

Pinterest
Provides media type plugin for Pinterest.

Namespace

Drupal\media_entity_pinterest\Plugin\media\Source

Code

public static $validationRegexp = [
  // Match PIN_URL_RE.
  '@^\\s*(https?://)?(\\w+\\.)?pinterest\\.([a-zA-Z]+\\.)?([a-zA-Z]+)/pin/(?P<id>\\d+)/?\\s*$$@i' => 'id',
  // Match BOARD_URL_RE.
  '@^\\s*(https?://)?(\\w+\\.)?pinterest\\.([a-zA-Z]+\\.)?([a-zA-Z]+)/(?P<username>\\w+)/(?P<slug>[\\w\\-_\\~%]+)/?\\s*$@iu' => 'board',
  // Match BOARD_SECTION_URL_RE.
  '@^\\s*(https?://)?(\\w+\\.)?pinterest\\.([a-zA-Z]+\\.)?([a-zA-Z]+)/(?P<username>\\w+)/(?P<slug>[\\w\\-_\\~%]+)/(?P<section>[\\w\\-_\\~%]+)/?\\s*$@iu' => 'section',
  // Match USER_URL_RE.
  '@^\\s*(https?://)?(\\w+\\.)?pinterest\\.([a-zA-Z]+\\.)?([a-zA-Z]+)/(?P<username>\\w+)/?\\s*$@iu' => 'user',
];