Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex street

// street & city must be separated by ',' or '.'
const addressStr = '123 Main St., New York, NY 10001, USA';

const street = addressStr
  .match(/(w+s[A-z]+.?s?)+(?=(,s([A-z]+s?)+,s[A-Z]{2}sd{5}))/g)
  .toString();

console.log(street);
// 123 Main St.
Comment

PREVIOUS NEXT
Code Example
Javascript :: js countdown 
Javascript :: reload page after form submit javascript 
Javascript :: code that will execute at a certain day and time javascript 
Javascript :: Divide the number in js 
Javascript :: nextjs getserversideprops 
Javascript :: new date null javascript 
Javascript :: creating 2d array in javascript 
Javascript :: how to use infinite scroll in angular 
Javascript :: add class with jquery 
Javascript :: how to use js console log 
Javascript :: javascript alert 
Javascript :: how to make text channels in discord.js 
Javascript :: navigator.geolocation.getCurrentPosition(console.log,console.log) undefined 
Javascript :: javascript data types 
Javascript :: reverse the string in javascript 
Javascript :: remove comma from end of string javascript 
Javascript :: discord.js timeout 
Javascript :: innertext data form js 
Javascript :: javascript play audio from buffer 
Javascript :: optional chaining in js 
Javascript :: check if object is not defined js 
Javascript :: how play audio js 
Javascript :: make country flags in js 
Javascript :: convert a string to array in javascript 
Javascript :: lodash update object by id in array 
Javascript :: the sum of all first n natural numbers js 
Javascript :: javascript array filter duplicates in react 
Javascript :: javascript get width 
Javascript :: regex date 
Javascript :: javascript disable div 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =