Snippets Collections
<label
					aria-label="password"
					class="form-label"
					for="password"
				>Password</label>
				<p><small>6 - 12 characters, one number, one symbol, one uppercase and
						one lowercase letter.</small></p>
				<input
					class="form-control"
					title="Must be 6 - 12 characters and contain at least one number, one symbol, one uppercase and one lowercase letter."
					type="password"
					id="password"
					name="password"
					required
					pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{6,12}$"
				/>
(\w+)
to
"$1",
  
ASD
ZXC
  
to
  
"ASD",
"ZXC",
(wordone)|(wordtwo) # multiple words in any order
preg_match('/(.)\\1{4,}/', $text)
import re

print(re.search(r"[Pp]ython", "Python"))
print(re.search(r"[a-z]way", "The end of the highway"))
print(re.search(r"cloud[a-zA-Z0-9]", "cloudy"))

# put ^ before a character class to search for anything but the given character class
print(re.search(r"[^a-zA-Z]", "This is a sentence with spaces."))

# | as OR operator
print(re.search(r"cat|dog", "I like dogs."))
print(re.findall(r"cat|dog", "I like both cats and dogs."))
import re 
s = "string. With. Punctuation?" 
s = re.sub(r'[^\w\s]','',s) 
import re
if re.match(r"hello[0-9]+", 'hello1'):
    print('Yes')
((<url>)\n(<loc>))|((<\/loc>)\n.*\n.*\n.*\n(<\/url>))
star

Fri Apr 30 2021 22:00:34 GMT+0000 (UTC)

#regex
star

Mon Apr 12 2021 12:33:54 GMT+0000 (UTC)

#regular-expression #regex
star

Sat Mar 27 2021 11:46:04 GMT+0000 (UTC)

#php #regex
star

Sun Mar 21 2021 08:40:14 GMT+0000 (UTC)

#python #regex
star

Sat Oct 17 2020 16:34:53 GMT+0000 (UTC) https://www.quora.com/How-do-I-remove-punctuation-from-a-Python-string

#python #regex #punctuation
star

Wed Aug 12 2020 03:09:20 GMT+0000 (UTC) https://stackoverflow.com/questions/12595051/check-if-string-matches-pattern

#regex #python #match
star

Tue Jul 21 2020 07:06:16 GMT+0000 (UTC)

#urls #sitemap #regex

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension