Leverage the power of regular expressions to create an engaging user experience
About This Book
- Build and use patterns in JavaScript to solve real-world problems
- Simplify complex validation processes by mastering the pattern language in Regex
- A step-by-step guide along with a lot of real-world examples to manipulate text and crunch data, in URLs, paths, markup, and so on
Who This Book Is For
This book is ideal for JavaScript developers and programmers who work with any type of user entry data and want sharpen their skills to become experts.
What You Will Learn
- Structure your patterns and model different types of constraints
- Clean and optimize code with Regex's processing power
- Solve common use cases and situations
- Extract different types of fields correctly
- Embed regular expressions both in your UI and on the backend
- Efficiently create guard clauses in your functions using patterns
- Create blank capture groups to handle inconsistent data
- Capture parts of a pattern in a group to display, replace, or use character sets to match characters
In Detail
Regular expressions are patterns or templates that allow you to define a set of rules in a natural yet vague way, giving you the ability to match and validate text. Therefore, they have been implemented in nearly every modern programming language. JavaScript's implementation allows us to perform complex tasks with a few lines of code using regular expressions to match and extract data out of text.
This book starts by exploring what a pattern actually is and how regular expressions express these patterns to match and manipulate user data. You then move on to learning about the use of character classes to define a wild character match, a digit match, and an alphanumeric match. You will then learn to manipulate text and shorten data in URLs, paths, markup, and data exchange, as well as other advanced Regex features.
Finally, you will work through real-world examples, both in the browser and on the server side using Node.js.
Loiane Groner has over 9 years of software development experience. In her university, she demonstrated a great deal of interest in IT. She worked as a teacher's assistant for 2.5 years for algorithms, data structures, and computing theory. She represented her university at the ACM International Collegiate Programming Contest – Brazilian Finals (South America Regionals), and she also worked as the student delegate of the SBC (Brazilian Computing Society) for 2 years. Loiane won a merit award in her senior year for being one of the top three students in her course. She had one of the highest GPAs in the computer science department, and also graduated with honors. She has already worked at multinational companies, such as IBM. Her areas of expertise include Java SE and Java EE and also Sencha technologies (such as Ext JS and Sencha Touch). Nowadays, Loiane is working as a software development manager at a financial institution where she manages overseas solutions. She also works as an independent Sencha consultant and coach. Loiane is also the author of Ext JS 4 First Look, Mastering Ext JS (first and second editions), Sencha Architect App Development, and Learning JavaScript Data Structure and Algorithms, all published by Packt Publishing. She is passionate about Sencha and Java, and she is the CampinasJUG (Campinas Java Users Group) leader and an ESJUG (Espirito Santo Java Users Group) coordinator, both of which are Brazilian JUGs. Loiane also contributes to the software development community through her blogs, which can be found at http://loianegroner.com (the English version) and http://loiane.com (the Portuguese-BR version), where she writes about IT careers, Ext JS, Sencha Touch, PhoneGap, Spring Framework, Java, and general development notes and also publishes screencasts. If you want to keep in touch with her, you can find her on Facebook (https://www.facebook.com/loianegroner) and on Twitter (@loiane).
Gabriel Manricks is a full-stack software and web developer, and a writer. He is the CTO at CoinSimple and a staff writer at Nettuts+, where he enjoys learning as well as teaching others. He also freelances in the fields of web consulting, development, and writing.