JSFiddle - React, Tailwind, and code Playground

by aflynt

JavaScript

// In the name is flagged condition
  
  /*          */
  var url = "http://lfach.convio.net/site/TR/WTELN/LFAGeorgiaChapter?team_id=1694&pg=team&fr_id=1071";
  
  
  function checkforURL (value) {
  	var isURL = /[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i.test(value);
 	 //	var hasSpaces = /\s/i.test(value);
    
    if (isURL && !hasSpaces) {
  		console.log("Not salty");
      return true;
  	}
  	else {
  		console.log("There is a space beween the string");
      var found = true;
      return false;
  	}
    
  }
  
  checkforURL(url);
  

 // var test_string = "http://lfach.convio.net/site/TR/WTELN/LFAGeorgiaChapter?team_id=1694&pg=team&fr_id=1071";
  
  //var isURL = /[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i.test(test_string);
  
  var hasSpaces = /\s/i.test("SampleText");
  
  
  
  if (hasSpaces) {
  console.log("There are spaces");
  }
  else {
  console.log("There is no space beween the string");
  }