Skip to content

Instantly share code, notes, and snippets.

@SoulCookie
SoulCookie / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Created November 6, 2017 08:41 — forked from ccstone/BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2016/02/29 17:26
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
###############################################################
### Universal Skills PC/NPC
###############################################################
@{selected|wtype}&{template:simple} @{selected|rtype}?{Skill
|Acrobatics,+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{rname=^{acrobatics-u}}} {{mod=[[ [[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]
|Animal Handling,+[[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]]}} {{rname=^{animal-handling-u}}}{{mod=[[ (@{selected|animal_hand
on('ready',function(){
"use strict";
on('chat:message',function(msg){
var content,token,character,bio,who;
if('api' === msg.type && msg.content.match(/^!inspect/) ){
content = msg.content.split(/\s+/);
token=getObj('graphic',content[1]);
if(token){
on('ready',()=>{
on('chat:message',(msg)=>{
if('api'===msg.type && msg.content.match(/^!set-color/i)){
const player = getObj('player',msg.playerid);
const cmd=msg.content.split(/\s+/);
if(player){
if(cmd.length>1 && cmd[1].match(/^#[0-9a-f]{6}/i)){
player.set({color: cmd[1]});
} else {
sendChat('',`/w "${player.get('displayname')}" Use <code>!set-color color</code>`);
on('ready',function(){
"use strict";
var removeTokenTurn = function(tid) {
Campaign().set({
turnorder: JSON.stringify(
_.reject(
( '' === Campaign().get('turnorder') ? [] : JSON.parse(Campaign().get('turnorder')) ),
function(to) {
return to.id === tid;