This regular expression will find Canada Postal Code in a string.
[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d
Canada uses ANA NAN format.
/* Basic Loop in BASIC progamming language | |
* For more BASIC / BAS resources - | |
* [BASIC Programming/Beginning BASIC/Control Structures/FOR...NEXT - Wikibooks, open books for an open world] | |
* https://en.wikibooks.org/wiki/BASIC_Programming/Beginning_BASIC/Control_Structures/FOR...NEXT | |
* [WHAT IS BASIC?] | |
* https://en.wikipedia.org/wiki/BASIC | |
*/ | |
Dim i as Integer = 10 | |
FOR i = 1 TO 10 |
[ "Peter Piper picked a peck of pickled peppers<br>\nA peck of pickled peppers Peter Piper picked<br>\nIf Peter Piper picked a peck of pickled peppers<br>\nWhere’s the peck of pickled peppers Peter Piper picked?", | |
"Betty Botter bought some butter<br>\nBut she said the butter’s bitter<br>\nIf I put it in my batter, it will make my batter bitter<br>\nBut a bit of better butter will make my batter better<br>\nSo ‘twas better Betty Botter bought a bit of better butter", | |
"How much wood would a woodchuck chuck if a woodchuck could chuck wood?<br>\nHe would chuck, he would, as much as he could, and chuck as much wood<br>\nAs a woodchuck would if a woodchuck could chuck wood", | |
"She sells seashells by the seashore", | |
"How can a clam cram in a clean cream can?", | |
"I scream, you scream, we all scream for ice cream", | |
"I saw Susie sitting in a shoeshine shop", | |
"Susie works in a shoeshine shop. Where she shines she sits, and where she sits she shines", | |
"Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had |
[ | |
"time", | |
"year", | |
"people", | |
"way", | |
"Man", | |
"Day", | |
"thing", | |
"child", | |
"Mr", |
/// Published to help someone out with this task! If they are reading this - hope this helped you! :) | |
// - ps check out @ https://github.com/MarketingPipeline and feel free to star something! :D | |
import { containerBootstrap } from "https://cdn.skypack.dev/@nlpjs/core@4.26.1"; | |
import { Nlp } from "https://cdn.skypack.dev/@nlpjs/nlp@4.26.1"; | |
import { LangEn } from "https://cdn.skypack.dev/@nlpjs/lang-en-min@4.26.1"; | |
(async () => { | |
const container = await containerBootstrap(); |
import stringSimilarity from "https://cdn.skypack.dev/string-similarity@4.0.4"; | |
var extractValues = function(str, pattern, options) { | |
options = options || {}; | |
var delimiters = options.delimiters || ["{", "}"]; | |
var lowercase = options.lowercase; | |
var whitespace = options.whitespace; | |
var special_chars_regex = /[\\\^\$\*\+\.\?\(\)]/g; | |
var token_regex = new RegExp( delimiters[0] + "([^" + delimiters.join("") + "\t\r\n]+)" + delimiters[1], "g"); |
function getOrdinal(number) { | |
if (typeof number !== 'number' || isNaN(number)) { | |
throw new Error('Input must be a valid number'); | |
} | |
const suffixes = ['th', 'st', 'nd', 'rd']; | |
const remainder = number % 100; | |
const suffix = suffixes[(remainder - 20) % 10] || suffixes[remainder] || suffixes[0]; | |
return number + suffix; |
function numberToWords(number) { | |
const units = [ | |
'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', | |
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen' | |
]; | |
const tens = [ | |
'', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety' | |
]; |
This regular expression is for finding common time format in string. Example 5:18pm
(1[0-2]|0?[1-9]|(1[0-2]|0?[1-9]):([0-5][0-9])|(1[0-2]|0?[1-9]).([0-5][0-9]))\s?([AP]M|[AP].M|o'clock|oclock|noon|afternoon|in the morning|in the evening|this morning|this evening|later this evening|tonight|at night|at noon|midnight|[ap]m|[ap].m)
at 5:12pm oclock tommo