Skip to content

Instantly share code, notes, and snippets.

@gitzx
gitzx / RegExp-html.js
Last active November 22, 2018 11:04
JavaScript判断HTML标签正则
// HTML标签
/<([a-z]*)\s*[^>\/]*?\/?>(.+<\/\1>)?/gi
// A标签HREF值
/<a(?:\s+.+?)*?\s+href=\"([^\"]*?)\".+>.*?</a>/gi
// 电话号码正则表达式(支持手机号码,3-4位区号,7-8位直播号码,1-4位分机号)
/(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$/gi
// 匹配Email地址
@gitzx
gitzx / MiniJSON.cs
Created May 25, 2018 03:29 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining