Jump to content

.London Domains - £4
Photo

JS Regular Expressions

javascript learning validation

  • Please log in to reply
5 replies to this topic

#1 historygirllfc

historygirllfc
  • Hefty Member
  • Advanced Member
  • 629 posts

Posted 08 April 2018 - 15:01

So I'm trying to (slowly) improve my JS skills. I'm avoiding jQuery for time being I get the basics of that seems pretty straightforward but given the ever changing and improving JavaScript ecosystem I figured my time would be better spent sticking to vanilla JS. I've come up with a few ideas to develop the first thing was some form validation as this would also help with work.

 

But I figure the best way to do this with some regular expressions which something I have yet to fully master I know you can match ranges or specific characters. Anyone have any tips on getting grips with these?

 

Any input appreciated.


  • 0

YNWA


#2 Lewwy

Lewwy
  • Global Mod
  • Mr. T
  • 1,053 posts

Posted 10 April 2018 - 13:05

Sorry, I don't really know how to help - but I did find this website a while ago which might help you while learning.

 

https://regex101.com/

 

Cheers,

Lewis.


  • 0

#3 Gibson

Gibson
  • Hefty Member
  • Flogging Gibbo
  • 1,809 posts

Posted 12 April 2018 - 03:46

Ah REGEX. How I love thee.

 

You're going to have real fun with this  :spiteful: .

 

It's quite easy if you find the expressions ready made that you want. What gets a bit mind bendingly "interesting" shall we say, is when you try and write your own ones. The slightly more advanced ones anyway. Start real slow and simple.


  • 0

#4 Renaissance-Design

Renaissance-Design
  • Global Mod
  • Code Poet
  • 1,567 posts

Posted 16 April 2018 - 10:21

"Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems." - Jamie Zawinski


  • 0

Chris Cox is a freelance web designer & developer based in Bridgend, South Wales. You should definitely follow @RenaissDesign on Twitter.

Need a blank theme for a WordPress project? Check out Tabula Rasa. Was this post helpful? Buy me a beer.


#5 historygirllfc

historygirllfc
  • Hefty Member
  • Advanced Member
  • 629 posts

Posted 16 April 2018 - 11:44

"Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems." - Jamie Zawinski

 

Haha I'm sure that rings true in many cases, however honest question if I wanted to valid form input why would I not use regex? How else would you validate form input?


  • 0

YNWA


#6 Gibson

Gibson
  • Hefty Member
  • Flogging Gibbo
  • 1,809 posts

Posted 18 April 2018 - 23:50

Well as far as I know, you would. But maybe use pre-made ones to start off with.

 

It's a bummer. A bit like learning how to write custom mod rewrites.


  • 0





Also tagged with one or more of these keywords: javascript, learning, validation

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users