-
Run a container with a default bash command.
docker container run -it --name container_name ubuntu bash
docker container run [OPTIONS]
--name CONTAINER_NAME
ubuntu COMMAND
class FetchWrapper { | |
constructor(baseURL) { | |
this._baseURL = baseURL ; | |
} | |
get baseURL (){ | |
return this._baseURL ; | |
} |
// We have 2 capture groups of each quote type, and than replace each on with | |
"h\"ell'o there".replace(/(")|(')/g, '\\$1$2'); | |
const escapeHtml = (unsafeText) => { | |
return unsafeText | |
.replaceAll('&', '&') | |
.replaceAll('<', '<') | |
.replaceAll('>', '>') | |
.replaceAll('"', '"') |
export const cloneMapShallow = (originalMap) => { | |
return [...originalMap.keys()].reduce( | |
(cloneMap, key) => cloneMap.set(key, originalMap.get(key)), | |
new Map() | |
); | |
}; |
const onlyHebrewPattern = new RegExp(/^[\u0590-\u05FF ,.'-]+$/i); | |
const isValid = onlyHebrewPattern.test(value); |
<?php | |
// validate that the provider name contians only "hebrew" characters. | |
if (!preg_match("/^\p{Hebrew}+$/u", str_replace(' ', '', $element['#value']))) { | |
$error_message = t('שם ספק יכול להכיל אך ורק תווים בעברית'); | |
form_set_error($element['#name'], $error_message); | |
} |
<?php | |
class ValidationsService { | |
public static function isValidPhoneNumber($val) { | |
$pattern = "/^((\+972|972)|0)( |-)?([1-468-9]( |-)?\d{7}|(5|7)[0-9]( |-)?\d{7})$/"; | |
return preg_match($pattern, $val); | |
} | |
} |
# Represent any number | |
\d | |
# Anything but a number | |
\D | |
# Represent any space | |
\s | |
# Anything but a space |