Jump to content

RegX problems


otuatail

Recommended Posts

<?php
// Library SMS3S Version 1.0.0   15-03-2014 
include ("../secure/SecureFunctions.php");
session_start();
Session_Init();

$name1= "O'Brian"; // Match O' if second character is (')
$name2 = "Robinson";

$myReg = "/(O')[A-Za-z]{12} | [A-Za-z]{14}/";

if(preg_match($myReg, $name1))
   echo "Yes";
else
   echo "No";

echo "<br><br>";
  
if(preg_match($myReg, $name2))
   echo "Yes";
else
   echo "No";
?>

I am trying to put together a simple surname match with a slight difference. Any help on RexX?

 

Link to comment
https://forums.phpfreaks.com/topic/287226-regx-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.