What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-03-09 10:50:04
/([a-z-0-9-]*) php
RedirectMatch 301 ^/news/([0-9]+)-(.*) /blog RedirectMatch 301 ^/news/([a-z]+)-(.*)/$ /blog/$1 These are regular expressions ("regex" for short). Specifically, Apache uses PCRE (Perl Compatible Regular Expression) syntax (the same as PHP, simi... Add solution -
Javascript 2022-01-30 21:31:17
how to make a string in javascript
var abc = "abcdefghijklmnopqrstuvwxyz"; var esc = 'I don\'t \n know'; // \n new line var len = abc.length; // string length abc.indexOf("lmno"); // find substring, -1 if doesn't contain abc.lastIndexOf("lmn... Add solution -
Shell/Bash 2021-11-21 07:06:16
dos findstr with plus
# EXAMPLE: display the files (within the given folder) that contain the text "+renew" findstr /n /l "+renew" "C:\Users\LongW\*" # SYNTAX # findstr <options-if-any> "<string-to-find>" "<path(s)-... Add solution -
VBA 2021-11-13 08:31:11
regex numeric digits
' Needs reference "Microsoft VBScript Regular Expressions 5.5" Dim rRegex As Object Set rRegex = CreateObject("VBScript.RegExp") rRegex.Pattern = "[0-9]{8,9}" ' 8 or 9 numbers MsgBox rRegex.test("12345678") ' Tr... Add solution -
Shell/Bash 2021-11-13 07:10:10
dos findstr
# EXAMPLE: display the files (within the given folder) that contain the text "+renew" findstr /n /l "+renew" "C:\Users\LongW\*" # SYNTAX # findstr <options-if-any> "<string-to-find>" "<path(s)-... Add solution -
Html 2021-11-09 11:49:31
parse html with regex
You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consu... Add solution -
Shell/Bash 2021-11-09 06:01:15
regex match any number of digits
' Needs reference "Microsoft VBScript Regular Expressions 5.5" Dim rRegex As Object Set rRegex = CreateObject("VBScript.RegExp") rRegex.Pattern = "[0-9]{8,9}" ' 8 or 9 numbers MsgBox rRegex.test("12345678") ' Tr... Add solution -
Javascript 2021-11-02 10:12:10
limit values that satisy a url parameter react-router
{/* It's possible to use regular expressions to control what param values should be matched. * "/order/asc" - matched * "/order/desc" - matched * "/order/foo" - not matched*/} <Route path="... Add solution -
Javascript 2021-10-15 01:23:03
regular expression flags
Besides the regular expressions, flags can also be used to help developers with pattern matching. /* matching a specific string */ regex = /sing/; // looks for the string between the forward slashes 9case-sensitive)… matches “sing”, &ld... Add solution -
Javascript 2021-10-09 01:56:03
js concatenate regex
const a = /a/ const b = /b/ // Concatenate two Regular Expressions with an OR | const c = new RegExp( a.source + "|" + b.source ); // c --> /a|b/ "a".match(c) // ["a", index: 0, input: "a", groups: undefined] &q... Add solution