Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

regExp for finding a first letter and last letter in a string

var regex = /^(.).*1$/;

console.log(
  regex.test('abcdsa')
)
console.log(
  regex.test('abcdsaasaw')
)
 Run code snippetHide results
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regExp #finding #letter #letter #string
ADD COMMENT
Topic
Name
3+5 =