A few regular expressions to parse WIFI schemes such as:
WIFI:T:WEP;S:test;P:rainbows\;unicorns\:jedis\,ninjas\\ secure;;
###Raw (?<=T:)[a-zA-Z]+(?=;)
| void randomDelay(float min, float max){ | |
| int random = (int)(max * Math.random() + min); | |
| try { | |
| Thread.sleep(random * 1000); | |
| } catch (InterruptedException e) { | |
| // TODO Auto-generated catch block | |
| e.printStackTrace(); | |
| } | |
| } |
| var incrementString = function(string, count){ | |
| var newString = []; | |
| for(var i = 0; i < string.length; i++){ | |
| newString[i] = String.fromCharCode(string[i].charCodeAt() + count); | |
| } | |
| newString = newString.join(''); | |
| console.log(newString); | |
| return newString; | |
| } |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class LocalizationHelper { | |
| //Any series of 1-2 digits followed by a colon followed by 1-2 digits | |
| private static Pattern timePat = Pattern.compile("\\d{1,2}:\\d{1,2}"); | |
| /// <summary> | |
| /// Regular expression built for C# on: Tue, Nov 22, 2011, 07:58:22 PM |
| //The includes required | |
| #include "time.h" | |
| #include "stdio.h" | |
| FILE *logfile; | |
| /* | |
| * Compares two time intervals and returns the time | |
| * difference in milliseconds. | |
| */ |
| #!/bin/bash | |
| #Sleep interval | |
| S=$1 | |
| #filename suffix | |
| suffix="s.log" | |
| while(true) | |
| do |
| Single-line version of pattern: | |
| (?i)\b((?:http(?:s)?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.][a-z]{2,4})(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\)){0,}(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) | |
| Extended version of same pattern: | |
| (?i) #Ignore Case | |
| \b | |
| ( # Capture 1: entire matched URL | |
| (?: | |
| http(?:s)?: # http: and https: only |
| var numbers = new Array("5035551234", "5035551235", ""); | |
| var messageText = "where?"; | |
| console.log('Started script: Send location to number using google maps'); | |
| // Register callback on sms received event | |
| device.messaging.on('smsReceived', function (sms) { | |
| //Allow using +1 or not +1 in phone number definition | |
| var sanitizedFrom = sms.data.from; |
| var time = "6:30 AM"; | |
| var temperatureBar = "below"; | |
| var temperature = "55"; | |
| var unitType = "i" /* Fahrenheit */; | |
| var weatherCondition = "rainy"; | |
| function showForecast() { | |
| // Get the current location | |
| var locationListener = device.location.createListener('CELL', 2); | |
| locationListener.on('changed', function (locSignal) { |
| -------------------------------------------------------------------------------- | |
| function InputAI.onKeyboardKeyDown ( kKeyCode ) | |
| -------------------------------------------------------------------------------- | |
| if( kKeyCode == input.kKeyW ) | |
| then | |
| --handle W | |
| elseif( kKeyCode == input.kKeyA ) | |
| then | |
| --handle A |