Blog

Archive for the Regular Expressions Category


Determine if a String Contains a Palindrome in JavaScript
Posted on December 7, 2017 in Algorithms, JavaScript, Regular Expressions by Matt Jennings

Determine if a string contains a palindrome in JavaScript.
Strip out any non Latin alphabetic characters if needed.

var str = ‘!Noel …

Read more


In JavaScript Show Longest Word in a String
Posted on November 28, 2017 in Algorithms, JavaScript, Regular Expressions by Matt Jennings

function longestWord(sen) {
// ‘sen’ is a string and ‘match’
// matches all the items in the …

Read more


PHP Regular Expression Examples using preg_match()
Posted on January 25, 2016 in PHP, Regular Expressions by Matt Jennings

<?php
function test($my_pattern, $my_string) {
$output = ‘<p><strong>My String:</strong><br />’ . $my_string . ‘</p>’;
$output .= ‘<p><strong>My Pattern:</strong><br />’ …

Read more