Regex for URL

var expression = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi

filename from path includes whitespace names

var get_filename_from_path = /(?!\\)+([\w+\s-])*(?=\.)/g

Date to YYYY-MM-DD

const yourDate = new Date()
yourDate.toISOString().split('T')[0]

slow chunk substr

function chunkString(str, length) {
  return str.match(new RegExp('.{1,' + length + '}', 'g'));
}

remove whitespace

name.replace(/\s+/g, "")

captures everything between the first ”(” and a semicolon (non-inclusive of the semicolon)

[\(]([^;]*)

specialized

(?:\[)(".*.")(?:\]\s=\s)([\\(].*[\\)])(?:,)
 
["OFF"] = (SevenBitNumber)int.Parse("00", System.Globalization.NumberStyles.HexNumber),
 

group 1 = “OFF” (the expression between brackets, not including the brackets) group 2 = everything after the equal sign except for the comma

explanation:

  1. (?:\[)
  2. matches but doesn’t capture an opening bracket
  3. (".*.")
  4. matches and captures any sentence enclosed with quotes
  5. (?:\]\s=\s)
  6. matches but doesn’t capture closing bracket, space, equal sign space
  7. ([\\(].*[\\)])
  8. matches and captures an opening parentheses, any number of characters and a closing set of brackets this will keep going until the last parentheses!!
  9. (?:,)
  10. this matches the end of the string (the comma) without capturing, but it could also be a semicolon or an end of line this took me like an hour.

anchor tags <a *>*

(<a[\s\S]+?>(.+)<\/a\s*>)

doesn’t work on vscode but works on regexr

((http.+)\s\|\s(.*\S))

3 is the name

regexr.com/7kfdb

converts foxy tab all tab and titles to url to markdown

(.+)(\nhttp.+\n)

replace:

[$1]($2)