Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js reg expression pick uppercase

const str = "HERE'S AN UPPERCASE PART of the string";
const upperCaseWords = str.match(/([A-Z][A-Z]+|[A-Z])/g);
// => [ 'HERE', 'S', 'AN', 'UPPERCASE', 'PART' ]
/* - start of the word
  [A-Z] - Any character between capital A and Z
  [A-Z]+ - Any character between capital A and Z, 
   but for one of more times and without interruption
  | - OR
   - start of the word
  [A-Z] - Any character between capital A and Z
   - end of the word
  g - global (run multiple times till string ends, 
      not just for one instance)*/
Comment

PREVIOUS NEXT
Code Example
Javascript :: js dom get website name 
Javascript :: take input from input array field jquery 
Javascript :: how to check if object is undefined in javascript 
Javascript :: let count = 0;console.log(parseInt("count"+ 1)); 
Javascript :: how to add comment in react js 
Javascript :: hide bootstrap modal jquery 
Javascript :: how to find angle between two points 
Javascript :: randome words api 
Javascript :: regex space javascript 
Javascript :: map over object javascript 
Javascript :: canvas draw image not blurry 
Javascript :: javascript detect collision 
Javascript :: how to display uploaded image in html using javascript 
Javascript :: is array equal javascript 
Javascript :: js foreach querySelectorAll 
Javascript :: remove empty or whitespace strings from array javascript 
Javascript :: selectpicker append option 
Javascript :: react interpolation string html 
Javascript :: capitalize first letter javascript 
Javascript :: javascript convert string to number 
Javascript :: javascript to mask email address 
Javascript :: https package node post request 
Javascript :: angular 8 how to iterate json object in view 
Javascript :: get rid of header bar react native 
Javascript :: node read csv 
Javascript :: js canvas line end 
Javascript :: create react app and tailwind 
Javascript :: fs get random file in folder 
Javascript :: json file to object js 
Javascript :: get the sum of Json values javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =