What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-25 18:01:04
javascript find a digit in str
var regex = /\d+/g; var string = "Any string you want!"; var matches = string.match(regex); // creates array from matches if (matches){ // There is a digit in the string. } else { // No Digits found in the string. } Add solution -
Javascript 2021-09-13 16:03:04
js detect link in string
function replaceURLs(message) { if(!message) return; var urlRegex = /(((https?:\/\/)|(www\.))[^\s]+)/g; return message.replace(urlRegex, function (url) { var hyperlink = url; &... Add solution -
Python 2021-09-09 09:00:03
regex
Let regex; /* shorthand character classes */ regex = /d/; // matches any digit, short for [0-9] regex = /D/; // matches non-digits, short for [^0-9] regex = /S/; // matches non-white space character regex = /s/; // matches any white space character regex ... Add solution -
Javascript 2021-08-30 06:45:02
javascript match image attribute value
var str = "<img alt='' src='http://api.com/images/UID' /><br/>Some plain text<br/><a href='http://www.google.com'>http://www.google.com</a>"; var regex = /<img.*?src='(.*?)'/; var src = regex.exec(str)[1]; cons... Add solution