 So, good morning, y'all. Good morning, Paul. It was not quite as impressive as I thought. Let's try again. Good morning, y'all. Good morning. There, that's what I'm looking for. All right, so my name is Paul. And I'm thrilled to be here to talk to you about what I think is a particularly exciting topic. And that's regular expressions. Now, if you just muttered, you need help underneath your breath, or under your breath. Totally get that. There are a lot of people that have struggled with regular expressions in it, because it does have a bit of a learning curve. In fact, how many of you have never used regular expressions? Anybody, a couple of you? How many have you used them, but do find them very frustrating? All right, it is my goal. It's my hope today that I can be that catalyst. I can be that push to get you over that initial hump in the learning curve. In fact, I personally have a goal to make sure that everybody, when you leave here, you've learned two new things about regular expressions that you don't know right at this moment. If you, if I fail in that goal, then please come and see me and I'll come up with some special tricks for you. So real quick, and I did not turn this on, so let me turn that back on. There we go. There we go. So real quick, what I'm going to cover. We're going to talk about what regular expressions are. Talk briefly about what they are not. Talk about what's in it for you or what we can do with regular expressions. Then we'll dive into all those different hieroglyphic symbols that we've seen before in a regular expression and talk about each one of those. I'm going to demonstrate on screen. I was hoping you could follow along, but I'll demonstrate on screen what each of them do and how they change what we're matching as we use those different symbols. And then hopefully with enough time, we're going to play a game. Collaboratively, we're going to build some regular expressions to solve a puzzle. So that's the part where you're going to have to yell out. So I'm going to make sure you talk back to me. So regular expressions. Oh, I was going to talk about the follow along. If, I guess nobody really can follow along because you don't have Wi-Fi, but I do have a repository out based on this presentation with a bunch of sample dictionary words that you can use to follow along. And I'm going to be using a tool called RegEx 101. So if you'd like to use that. And you should have access to these slide presentations too as well so you don't have to worry about writing all this down. So, regular expressions. Regular expressions actually originated back in the early 1950s by mathematician Stephen Cole Clean. He was trying to come up with a way to describe languages in a formal language theory. Essentially coming up with an algebraic way to describe languages. Now that's probably not what you and I think of in terms of when we hear the term regular expression, right? What we probably think of is something more like this. Right? And if you're listening in, we've got an animation of Bert from Sesame Street who is passing out after seeing a fairly long regular expression. Now what we usually think of is a series of characters that are used to represent some type of pattern that we're trying to find in a larger body of strings or text. Now, what regular expressions are not? One, regular expressions are not a programming language. So if you are not a programmer, I hope you now have some hope that you can actually use these things because they're not a programming language. They do have some basic branching, some conditionals, but they're not a programming language. They're also not un-learnable. I've had more than one person in these sessions say, you know, regular expressions are, there's nothing regular about regular expressions. They're very hard. You just, I'm hoping, really truly hoping that I can be that light bulb, that aha moment that gets you over that hump and illuminate exactly how regular expressions can be powerful and they can be a powerful tool in your toolkit. The other thing is they're not the solution to every problem. I don't know about you, but I have a really bad habit when I learn a new powerful tool. Suddenly, everything looks like I can solve it with that new tool, right? In fact, if you've seen this XKCD comic, for those of you listening in, we've got two stick figures, one saying, if you're having pearl problems, I feel bad for you, son. I got 99 problems, so I used regular expressions and now I've got 100 problems. And it's true. When used inappropriately, or used in an unoptimized manner, you could actually make things worse using regular expressions. So we'll talk about that as well. So what do we use regular expressions for? Anybody have a guess initially? What's that? Perfect. And you said what else? I use redirect. Redirect? All right, so a couple of things we can use them for. We can use them for finding text, finding things inside. Think of control effort command F. It's like that but on steroids. In fact, if you're trying to find some strings and some information inside a larger butter text and you're not finding what you're wanting, you're getting too many false positives, a regular expression might be able to help you out. Another one is validating text. Like you just said, you're sure an email is an email. So if you're receiving input from some outside sources, regular expressions can help validate that what you're receiving is what you want. We can also do string manipulation. We can pluck out pieces of information from that larger body, do things with them and put them back in. Now, some of you, you're either tired or you don't look impressed. So I'm gonna give you some concrete examples of where you can use regular expressions in areas you might not have thought of before. So let's say you've got an article on wolves in a word doc or Google doc and you need to find every instance of the word wolf or wolves as it pertains to anything except, where's my mouse pointer? Except red wolves and I can't use them. So we wanna find gray wolves, brown wolves, rare wolves, so we can use a regular expression and now notice gray wolves is highlighted, rare wolves is highlighted, but red wolves is not. All right, so Google Docs support them. Let's say you've got an Excel spreadsheet and you're importing some information and it's phone numbers. And those phone numbers have come in in all different kinds of formats, right? But you need them to be formatted in all the exact same way. So again, we can use a regular expression inside Google Sheets or Excel spreadsheets, grab, pluck out those different individual numbers and then reformat them so they're all the exact same. So hopefully your reaction's like that. The next one I usually show is a demonstration on how you can use regular expressions inside Google Tag Manager to clean up the data or extract data that you don't need. Unfortunately, it's about three or four minutes and I wanna make sure we have time for the game at the end so pretend I showed it to you and this is your reaction. All right, so how do we actually use it? So I said earlier, regular expressions are a series of characters that we use to represent patterns. Well, we have all kinds of characters. We have literal characters. We have special characters. We have something called character classes. We even have shorthands for those character classes. We have lots and lots of characters. So what I wanna do is walk through all of them individually and show them to you and how it changes what matches. So let's start with literal characters. Literal characters are exactly what they sound like. They are literal characters. In this example, with F-O-N-O, I'm telling the regular expression engine, I want you to find the literal character F followed by the literal character O and another O. So let me show that to you in my demo over here. Oops, with my mouse, there it goes. All right, so if I type in F-O-N-O, everybody can hopefully see this up here. My mouse just does not show. So we matched the F-O-N-O at the end of the string. We've matched it there in foo. We've matched F-O-O in foot, F-O-O in foo bar, F-O-O in bar foo. So every time F-O-N-O show up together, we've matched that. Good? All right, notice also at the beginning of that regular expression. And the end, just almost before the end, we have forward slashes. Those are referred to as delimiters. The delimiters define the boundaries or the edges of the pattern we want the regular expression to search for. You can use several characters to define those edges. It just so happens that the forward slash is the most common. Can anybody think of why we would need to change the delimiter? Yeah, so that very first one, if we wanted to search for that forward slash, we would need some way to be able to do that, right? So in many regular expression tools, this being one, you're often able to choose those different delimiters. So I could say, hey, I want the at symbol. So now if I type in foo, oops, I shouldn't have done that last one. You can see here it is matched forward slash foo. Make sense? Okay. Now I've used the term regular expression engine a couple of times. I want to pause and make sure everyone understands what I mean, but when I say that, regular expression engine is a piece of software that can read a regular expression, parse it, and then apply it to that body of text. Sometimes it's referred to as flavors. So notice over here, we have, again, I wish I had my mouse pointer there, we can choose from the different flavors. There are different flavors, and I'm gonna give you a series of warnings. So if you're listening in, I've got an animation about red flashing light to indicate a problem or something to watch out for. And that is that not every regular expression engine is the same. It is very similar to browsers in the 90s. Was anybody around back then? Couple of you? Well, what happened all the time in the 90s with browsers? Of course, compatibility. Yeah, compatibility was like best viewed in Netscape or best viewed in IE, right? Okay, regular expression engines are the same. They can all implement their own set of features. And one of the problems is there aren't really any standards for regular expressions. There's only one, and that's POSIX. And it's really old and very limited. So as you're building regular expressions, you need to be aware that what you're building may or may not work in a different regular expression engine. Now, if you've used them before, you might have come across the term PCRE, or Pearl Compatible Regular Expression. That is not an actual standard, but it has been adopted by the industry kind of as a quasi-standard. It's actually an open source library that was built to build compatible features with Pearl with what they had implemented way back when. But because it's an open source library, he's laughing, you know what happened, didn't you? Yeah, as it's expanded and gone on, Pearl later adopted features from Pearl Compatible Regular Expression Engines and implemented in its regular expression engine to make itself more compatible with Pearl Compatible Regular Expression Engines. Yeah, it's a little confusing. That's part of the reason why this gets a little hard. So the point is to always make sure you're testing in a tool, because it gives you a wealth of information. Not only can you choose the flavor, notice up here it's explaining exactly what it's trying to find based on that regular expression. It also gives me where it found the match and gives me a quick reference to different information about how to build regular expressions. The really good ones will even give you, you can see it in this one, a debugger will walk through and show you why it is or isn't matching what you think it should. So always use a regular expression tool. And that is your first bonus. So if you're listening in, I've got Oprah Winfrey pointing out, saying you get a bonus and you get a bonus and everybody gets a bonus. And there are a ton available. You know, Regex 101 just happens to be the one I'm using today. There's also Regex there, there's regular. If you like installed options, applications. If you're on Windows, you cannot go wrong with Regex Buddy. It's fantastic. If you're on Mac OS, we have expressions. But the point is to use those, let them help you build these things. All right, so here's our special characters. Here are those hieroglyphics. We have 12 special characters that we can use. The very first one is an escape character. So earlier when I had my delimiter set to here, notice it told me, hey, there's a pattern error. And if I hover over that, what does it say? Oops, that's the F. Let me scoot over just a little bit. Too far, too far. Goodness, can't quite get that today. On escape. So that backslash is the escape character. It tells the regular expression engine, okay, this next character that you're gonna come across, don't treat it like it's normal meaning, treat it like it's alternate meaning. So if this was a forward slash, it would say don't treat it as a delimiter, treat it as an actual forward slash character. That's all that backslash does. All right, the next one up is the carrot. It is part of a subgroup called anchors. Anchors don't match characters. They match positions. In this case, it is saying, hey, when you look for bar, only find matches where bar is starts at the beginning of the string of the line. It anchors this pattern to the front. So watch what happens when we use this. Let me come in here and get rid of this. So I've got foo, you know it's matching into foo, foo, foo, bar foo, if I come in here and use a carrot, watch what happens. Now what matched? Only the beginning. Only the beginning. So without it, with it. See how that happens? All right, so it's saying only match this foo pattern when it is at the beginning. All right, if we have a beginning, well, we need an end. So the accompanying anchor is the dollar sign. It says match at the end of a stringer line. So we'll come back over and do the same thing. We've got foo, it's matching at the beginning and the end if I add the dollar. Now what matches? Only those there at the end. Have you learned at least two things so far? Yeah, all right, done, everybody can go. No, just joking. So the next bonus for you is that whenever you can, always anchor, all right? Doesn't matter if your pattern's actually matching anyway, you should always go ahead and anchor for optimization because if you have anchored, then the engine doesn't have to waste time continuing to search for that pattern if it's not really what you want. For example, if we said anchor foo to the beginning, then if the engine comes across a string and it starts with a b, does it have to continue? No, it knows, this has to be at the beginning, I can just skip this piece and go to the next piece. All right, so whenever possible, anchor. The next special character is the beginning or the open square bracket. It is what tells the regular expression engine we want to define a character class. A character class is going to match a single literal character from the class. Inside the class, we can designate exactly the characters we want to search for, so we can say I want you to search for an a, or a d, or a g, all right? Now, if you wanted to search for every alpha character, it's going to get a little hard to read if you had to do a, b, c, d, e, et cetera. So it does allow us to create ranges. In fact, I think I had that example back here, yeah. In this case, we're saying I want you to find a single character that is in the range from a to z. Makes sense so far, all right? The ending square bracket is not a special character by itself, it's only a special character when used in conjunction with the beginning square bracket in order for us to create that character class. Inside the character class, other special characters are no longer special, they're regular characters with the exception of the ending one, because that makes sense, that's how we define the end. The backslash itself, because we need to be able to use it to maybe escape that one. The caret, which we'll talk about in a second, and the dash, which is because that's what defines our range. So back in my example here, if I were to do maybe I want to find everything that's b or r, and then o, o. So now that I've got boofar, rubaf, these are all fake words, I know what I do with these means, raboof, or I could come in and I could say, all right, I want to do a range of maybe everything between b and g, or I'd say h, but that's all right, still get the same thing, and now I'm back to matching the foo, boo, but not rubaf. Good, making sense, all right. So the next special character that we have is the caret symbol, and it's the negation character. As for those of you that are listening in, we've got an image of Michael Scott, our animation of Michael Scott, holding up his hand saying, wait a second. And this is a prize, a perfect example of why regular expressions are sometimes challenging to understand, because what did we just say the caret symbol did? Anchor, and now I'm telling you, it's not an anchor, it's negation. These symbols can have their meanings change based on where inside a pattern they're used and in conjunction with other symbols that they're next to. So in this case, if we use that caret inside of a character class, we're saying find any single literal character that is not any of these characters. Outside of the character class, it's an anchor. So let me show you this, so I'll come in here and I'll wipe this out again. So let's say I did F-O-O, but I really wanna say find anything that is something O-O that isn't F. Can use that caret, now watch how it happens. So now we're matching Bufar, we're matching question mark O-O, we're matching anything that isn't F. So outside it's an anchor to the beginning and you can use them together. I could do anchor and then another one inside. So inside, negation, outside, anchoring. Good, all right, woo, all right. So it can get really, really tough to build these character classes, right? Regular expression engines by default are case sensitive. So if I wanted to find any word that started with a letter, whether it was upper or lower or maybe a number, I'd have to do capital A through Z, lowercase A through Z, zero through nine. It gets really complex. So instead, most regular expression engines support short hands. Short hands typically, and it'll depend on the engine, but typically start with that backslash and then a normally literal character such as backslash lowercase D is actually the character class zero through nine. Backslash W is actually shorthand for capital A through Z, lowercase A through Z, zero through nine in the underscore. Plus the S and then there's about 25 more. Don't worry about remembering because remember over in our tool, if I scroll down here just a little bit, there we go, you can start to see that it gives you some of those shortcuts. Just know if you're evaluating a regular expression and you see a backslash in what normally you would think of as a literal character, that's probably one of these shorthand character classes. All right, see everybody's still good. All right, the next one is I call the weird one, the dot, the period. I do that because, you know, the carrot had the dollar sign it was partnered up with. The square bracket had the ending square bracket. They all had like little partners, right? The dot doesn't, it is all by itself and it stands for any single literal character except for new lines. It can stand in for anything. So if I come back out here to our little examples again and maybe do dot, oh, that's a zero, not an O. There you go, dot, O, O. It's matching foo, it's matching question, O, O, foo again, boo, roo, anything that's not a new line. All right, so just as you're reading those regular expressions, that dot says I can be anything that's not a new line character. Am I still good? Just making sure. It's hard to tell sometimes if you're lost or just tired. Okay, I'm gonna keep going then. The next one is an alternation character, the pipe symbol. It tells the regular expression, hey, I want you to find one of several things. In my example, I'm saying, okay, as you're going through, I want you to find an instance of BAR. If you cannot find BAR, I then want you to look for F-O-O. It creates a branch for the regular expression engine to follow. However, there is a warning, and that is regular expression engines like to return as quickly as possible. They like to find a match and then hand that match back. That means it is always gonna give preference to the left-hand side in an alternation. So in the example, there were many cats near the bowl with one cat by the door, because C-A-T is on the left-hand side, it has found a match in cats and is gonna return that match, even though C-A-T-S may be the more appropriate match. So just be aware when you're using those alternations, that's how it's gonna treat what's inside that alternation. That left-hand side is always gonna take precedence. All right, the next set are called quantifiers with several quantifiers that we can use. They tell the regular expression engine, the previous thing you asked me to look for, I want you to find a certain number of times. The question mark says I want you to find it either zero times or one time. So in the case of F-O-O-B-A-R, it will find foobar, because I can find it once, or it would find foobar. In fact, I think I have both of those out here, so if we do foo, question, B-A-R, not bat, I can't type, yeah, it's found foobar, but it also found foobar, because it's saying that other O is optional. However, there is a warning with these. Quantifiers turn on greediness. Greediness is when the regular expression engine wants to find as many things as possible. It's like the flip of the alternation. So if I were to do CATS question, it's always gonna try to find CATS first before it drops off the optional, and then finds just CAT. So it's the reverse, and it's important, especially when we use this next quantifier, the asterisk or the star. The asterisk says find either zero instances, optional, or as many as possible. So have you ever used a dot star? A couple of you, yeah, what does the dot stand for? Anything, right, except new lines. And then what does the asterisk stand for? As many times as possible, so you end up possibly inadvertently matching everything out to the end of the universe, because it'll just keep on eating things until it reaches a new line. So if we come back over here and do foo asterisk, notice it found foo bar and foo bar, but it also found foo bar. All right, the next one we have is a plus sign. It's like a combination of the first two. It says, I have to find at least one instance, but I can also continue consuming as many of those as possible. So in the example I just showed you, if I change that to a plus, it's only gonna, well not only, but it's gonna find foo car and these, because I've said it at least once, but it'll also find foo bar. Oh, I just, yeah, there we go. Am I still okay? All right, sometimes you need even more finesse, or you need more control over those quantities, those number of repetitions. And so that's where the curly brace comes into play. Curly brace combined with the incurly brace allows us to designate a specific number of repetitions. So the pattern is minimum, maximum, or minimum has to be zero or positive integer. Then the maximum has to be equal to or greater than the min. However, if you drop off the max, that stands for infinity. So earlier we had zero or one with a question mark, that's the same as saying zero comma one. The asterisk is the same as saying zero comma nothing, because that nothing stands for infinity. The plus sign then would be one comma nothing. And then if you admit the comma and the max, that means I wanna find something exactly X number of times. Still good? All right, and then just like the square bracket, the ending curly brace, it's not really special unless it's used in combination with that beginning one. All right, that is 10 of the 12 characters. We've got two left. You feel good to go into the last two? Good, but most people are shaking their heads. All right, that next set is the opening and beginning parentheses. These allow us to create subgroups. So what a subgroup does is when the regular expression engine gets to that group, it says, all right, I'm gonna pause and now I'm gonna jump into this group and begin looking for things here. And I love the example of that theater of theater. Make sure I can see that there. So let's say I wanted to find either spelling. All right, so T-H-E-A-T, it's found that. And then I wanna find theater or theater, E-R, which would match, or R-E. So I can do something like, E-question, R-E-question. Nah, that gets real complicated. Instead, I can do this sub-pattern and say, hey, in here I want you to find E-R or I want you to find R-E. And now I found both spellings. So it's a sub-pattern. This becomes really powerful when we combine those with the quantifiers because remember, the quantifier quantifies the previous thing we looked for. So if I add a quantifier to a group, it's gonna quantify the group. So if you think back to the phone numbers, I could do, hey, I wanna find a character class of zero through nine and I wanna find either three digits or four digits where they appear together. Then I could put that in a group and say, hey, I wanna find three instances where that happens. And I can expand out and make these more complicated patterns. Okay, so probably actually raise your eyebrows. All right, good, that means you're getting it. So then the very last set of characters is the open and closing parentheses. So for those of you that are listening in, we've got a young girl, about four or five. It's actually Rudy Huckstable from the Cosby Show, smacking herself in the head and saying, not again. In this case, it's not quite different. Any grouping is always gonna be a capturing group. What I mean by a capturing group is when the regular expression jumps into that group, if it finds a match, it stores what it finds in memory so that we can use it later on. In the case of those phone numbers, what I did is I said find three or four, find three or four, find three or four, and hold on to those. And now I wanna reuse those later on as group one, group two, and group three. So by default, you access those groups in the ordinal position they were created. So group one, group two, group three. Usually, in many of them, it's with a dollar sign. Some of them use a backslash and a number. And we've also even got named groups to make it even easier. That's a little bit more advanced. But we'll come in here real quick and I'll do a group, maybe bar. And if I change this from matching to substitution, now you can see I've accessed what I saved inside that group as dollar one and now it is replacing it with dash dash in what it saves. So now it's foo dash dash bar. This is what allows us to do that string manipulation so we can capture pieces of data and then put them back together. And you don't have to put them back together in the order you found them. So I could have the third group and then move it to the beginning. And then have the first group and then the second group and move them in any way I need to. All right, everybody's still okay. So we've gone, we've talked about literal characters, we've talked about special characters, we've talked about character classes, shorthand character classes is now time for a pop quiz. What does the plus sign do anymore? So it says I match what I just asked you to find at least once to infinity. Good job. What about the pipe? Or it creates an alternate branching. What about the square bracket, the opening square bracket? A character class. What about the carrot symbol? Anchor or negation, perfect. All right, I have one more bonus that I wanna share with you. This is an advanced topic. As I go through this, if this does not make sense, that's okay, this is an advanced topic. But I want you to be exposed to it so that when you are building regular expressions later, if it's just not finding what you want, you think back and you can say, maybe I need one of those look around things, all right? Plus we need it for the game. So a look around is referred to as a zero-length assertion. It's like the anchors. It's not gonna match and find characters. It's gonna match and say does something exist or not. That's that positive or negative. And we've got two types. We can look ahead or we can look behind. So in a pattern, I've gone, maybe I've got F-O and then we stop and we've got this look something. Look around. And if I have a look ahead, it says, all right, I now want you to pause and I want you to look ahead into the string and see if something is there positive or if something's not there negative. If it's a positive and it's there, then return true and keep finding things. Or I could say no, I want you to stop and I want you to look behind where you just went and see if something is there or not there. The thing that finally made this click for me was I was trying to find, I was trying to match the letter Q in every word where you did not follow the Q. So help me build this expression. How would I start with saying find a Q? Q. Then we learned earlier, we could do something to find not something. So how would we do that? Negate inside of a class, right? So bracket, don't find the U. And that kind of works. In other words, quit didn't match. I found a match with Qwerty and Quintars. But what about Iraq? Why didn't it match Iraq? It's the end and there is what's after it? Nothing and a character class has to match at least one literal character, right? So it didn't match. In addition, I don't want to match the W and I don't want to match the I. I just want to match the Q. So this is where those lookarounds come in. So what I can do is we create lookarounds with the group. We then use a question mark to tell the regular expression engine, this isn't a regular group, we want to do something special with it. In this case to do a negative look ahead, I use the exclamation. And then I can say, I want to make sure that the next character that follows, I want you to look ahead, but only continue matching if there's not a U. And now what have I matched? Only the Q's where there's not a U and that includes Iraq. So again, if you're like, I have no idea where you're going, that's okay, I just, like you said, I just want you to be exposed to it that this is a possibility because we're going to need it for the game too. All right, so we are going to play a game, we're going to play Wirtle. Is everybody played Wirtle? Yeah, we, that's, now before you say that's cheating, hold on, the goal isn't to solve the Wirtle, the goal is to see if we can build a regular expression that represents what the Wirtle is telling us. Does that make sense? Okay, so somebody said, ooh, I like that. So I've got a dictionary in here, I do not remember, but it's several tens of thousands of words. Okay, and I'm going to bring up Wirtle here and I'm going to bring up Cognito here. So hopefully my internet is still working. Yay, it is. All right, and before I start, I want to make sure I put this into high contrast mode, so you can see it. And if you've not played before, what we're trying to do is we're trying to guess a five-letter word. As we guess words, it's going to show us the letters that we've guessed and it's going to color them differently. I am colorblind. Is that first one green or orange? Orange. Oh, it's orange. I thought it was green. So if it shows up as orange, that means that is the correct letter in the correct location. If it shows up as blue. Yeah, okay. If it shows up as blue, that means it is, that letter is in the word, but it's in the incorrect position. If it shows up at gray, that means that letter does not show up in this word at all. All right, so this is where we are going to collaboratively work together. If I wanted to find a word with five letters, how would I start that? In a regular expression. Say that again? To designate what? Perfect. And so then if I wanted them to be anything that's A to Z, how would I build that part? So do bracket A through Z in bracket and then curly brace five. Perfect. So that says, hey, find any string of five letters. Now, is it gonna find five letters inside a 10 letter word? Yeah. So how would we tell the regular expression engine? I only want you to find these five letters when it constitutes or takes up the entirety of the line. Oh, perfect. Anchors. Anchors where? The front and back. Perfect. Yeah. So we want to do, oh, I'm so happy. Yes. You guys got it. So anchor at the front. Anchor at the front. You want one so low? There's an, oh, is there? Yeah. I didn't know there was a dirty word in there. My apologies. Oh, goodness. So we've gone from, I'm so sorry about that. I did not know there was one in there. I grabbed it from the dictionary. It was in the dictionary. So we've gone from, I don't know how many tens of thousands of words. We're now matching 14,000. I do want to capture these so that we can see them more easily down below in the list. All right. So we're all ready to go. We've got 14,000. And inside the wordle, I usually like to start with the word audio because that gives me A-U-I-N-O and knocks those out. However, I'm open to suggestions. Is there a different one you'd like to start with? I use trace. Trace, T-R-A-C-E. A doo. A doo, which is? A-D-I-E-U. Ooh, that's a good one too. Is that cool if we use that one? Okay, so it's A-D. I-E-U. I-E-U. Ready? Oh, I was on the wrong thing. Goodness, I got myself all excited. Oh, and if you played this today, don't yell out the answer until we get a little bit farther. All right, so now what is this telling us? We have an I-N-U that's where? Somewhere. And then do I just talk about how we can tell the regular expression. Hey, I want you to look, I don't want you to grab anything. I just want you to look to see if something is there. Ah, yes, that look around. So I'm gonna do a positive look around. What were the two characters again? Whoops. I-N-U. So I'm gonna say I want where an I shows up anywhere in here. And then I want another one where a U shows up anywhere in here. And we've gone from 207, 14,000 something down to 207 possibilities. But we're not done because what else does the word will tell us? Yeah, we do not want A, D, or E. So I'm gonna go back in here. I'm gonna change what we built earlier to say, whoops, let me make sure I grab this right. Oh, that's moving, I don't want that here. Let's wipe this out. Whoop. So then we're gonna say there's my capture group and the end. So we're gonna say, hey, we do not want A, what was it, A and what? A, D. D? I've already forgotten, goodness. A, D, and E. So we don't want A, D, or E. And we don't want that in which positions? One, what's that? Any position. Any position, but currently we definitely don't want it in the first two, right? Okay, so I'm gonna say quantity two. And then in the third position, we know we don't want A, D, or I. So I'm gonna come back here. I'm gonna build another one. So I'm gonna say not A, D, or I. And then in the fourth position, it was the same as the first one. So not A, D, or E. And in the last position, not A, D, E, or U. So not A, D, E, or U. And now, how many possible matches do we have? So we've gone from 14,000 something to 300 down to 104 in how many guesses? One guess. In one guess, we have shrunk that thing. I don't know, I can't do the math on my head. A whole bunch. So does anybody, and I'm sorry for this small space. I can't really make this bigger. Does anybody see a word in here? What's that? Do you want to begin with S? We'll scroll, I think these are kind of alphabetical, so we'll scroll. I do notice, like music, I think it's music. I mean, it is every word has an I and a U and then doesn't have these others, right? All right, so let's scroll. What did you say, S? I got, oh, there's not very many S words. In my C, and you hear pupil. What are we missing? We got A, E, I. We need an O, don't we? Or do we already O? I don't know if I even see it in here with it. Julio, I don't know what that word is. Curio? Which one? Fungi. Fungi, F-U-N-G-I, is that right? F-U-N-G-I, ready? Ooh, so now we know, oh goodness, now what do we know? What now? What's that? No FRG. No FRG and we also need an N, okay? So let's add that. And somebody make sure I always go over time. So if I'm going over time, somebody yell at me. Dot star, what was that, an N? Did I just say? Yeah, N, sorry. N dot star, close that out. Now we're down to 31, but we also know that the, we gotta add F and G in here to the ones we can't find. So let's do F and G, and then F, scoot over, F-G, F-G. And as I'm doing this, another thing I'll point out with regular expressions is just like everything else in life, there's about a billion ways to build a regular expression. The specific, the best way is gonna be on the context of what you're doing and what you're trying to accomplish. So we could build this in a bunch of different ways. This is probably not the most optimal. So now we know the first one, okay, well the second one can't be a U. Did we already do that? So, oh, nope, need to build in a second position then. So we know the second one can't be, what was it? A-D-I, no, A-D, what was it, U? And then, can't be, what else? Can't be A-D-E-F-G, A-D-F-O-G, F-O-G, and it all, oops, I put an H in there, and it can't be a U. Ah, it's living too many times. So first, second, and then the third one also can't be that N, so let's add that in there. And now we have 15 matches. See what I see, what I, something's not right. So why would you have beamy and glary? Beamy and glary, so let's look here. Oh, never mind, never mind, never mind. I got it. Rootin', tootin', cumin, cuttin', burnin', what's that? Units. Units? Units, okay. Units. Spell it, yeah? Oh, that's what I thought you said, okay, sorry. Ooh, so we definitely know that U and N is at the beginning, so we can wipe out the first two. U, N, and now what do we know? The third one still can't be an I. The fourth one can't be a T. So third, fourth one can't be a T. Now we're down, no match. What, fourth one can't be a T. First two are, do I leave one in? U, N, one, two, and three. I have messed up something, haven't I? One and two, three, what do I mess up? Take the N out of the third one. One, two, oh yes, sorry. There we go, now still no match. What do we do? Okay, so we have to have a U, N, I, and T. So we've got U, N, we don't have a T up in here. Got the last one, thank you. No match still. No, no, it can't be the U at the end. This is the hard part about doing a live demo. Okay, so we have to have an I, I'm sorry, I'm flipping too fast. We have to have an I, T, and N, and a U until, probably, but or twice. Oh, you know what we haven't added? We haven't said, hey, we can have a T anywhere. So we can have dot star, T dot star. Does that help? Nope, still no match. So we can have an I, we can have a U, we can have an N, we can have a T. We can't have A, D, E, F, G, or S anywhere. So A, D, A, D, E, F, G, S, A, D, A, D, E, F, G, or S in the third one, or an I in the third one, right? Where am I messing this up? Maybe it might not be in my word list. Oh, that's a possibility. Well, you know in the T are the last two, because. Yes? Well, I'm so sorry, this isn't working out. Normally this works out perfectly, and I have somehow messed this up. I tell you what, I'm gonna do it from the beginning again, so we get dot, end, and we want to capture, and we wanna do, we said A equals dot star. What were the three dot star? We had, we have to have I, U, N, and T. We have to have a unit, so U, we have to have dot equal dot star, dot star, and we had to have not eight. Eight. We have to have an eight in there. We had to have an N, correct? We have to have an N. Help me out here and remember there was an I. So we have to have an I. And we have to have a T, so we'll do one more equals. It is case-sensitive, but wordles shouldn't use any capitals. The capitals, it does have capitals, which is, those would be false positives. So that's okay. It shouldn't prevent us from finding them. And so then we know in the first one, we had is U and N, so we have a U and N. So now everything should start with a U and N. Why is it not capturing? No match. Saying I don't have any words at start. Oh, because I don't have the rest of them in there. Okay. So then, not, A-D-E-F-G-S. Not, A-D-E, A-D, thank you. I can't keep all these straight in my head. A-D-G-S, S-F-G-S. All right, what am I doing wrong here? I have totally messed this up somehow. Oh, I'm missing a dot right there. Ah-ha, our star. There's one problem. Still no matches. This is the first time this has never worked. This is an excellent illustration. Now I just want to solve it to find out what the freaking word is. Okay, let's guess, because I'm going to give up on the red jacks. Until. Unfit. Unfit? Yeah, it can't be unfit. It could be unlit, right? Let's try that. Yeah. Ah, it's unlit, not in here. Well, yeah, I'll just do that. I don't think it can show me unlit. Unlit, are you in there? Oh, is it not in there? Oh no, it says there's two, so it is in there. Okay, somehow I messed that up. I am sorry, it is in there. I don't know what I did wrong. Well, good, good. But you did see at least how we went from the thousands and thousands and was down where you're narrowing it down. Normally I can get this down where there's like two possibilities, right? In three guesses. So I'm hoping you see the power of regular expressions. I'm hoping you've got at least two new pieces of information. I don't think there is any extra times, but if you like to, there's word of clones. There are regular expression crosswords to kind of help you play through building regular expressions. I do want to acknowledge these resources. These are all fantastic places to learn about regular expressions and test regular expressions. I mean, I could not even begin to understand them without that, so I definitely give them credit. Do we have five minutes left? Yeah. Oh, okay. So what questions do you have for me? And I do apologize for messing that last piece up. Where are the, is anybody here from Board Camp Alabama? We are in Birmingham, sorry, yeah, Alabama, sorry. They're supposed to be available somewhere. If not, I will, I'll post them on my Twitter. I'm gilzo at Twitter. I'm gilzo everywhere, I'll just tell you that. So if you do a search for gilzo, there's only like 20 of us in the U.S., and I'm everywhere. So I've got gilzo pretty much everywhere. Any other questions? Where can you find a good resource with example patterns that you can use for regular stuff like an email or an address? So in all those tools, they'll give you those patterns. So we're just gonna come over here. They do group constructs, substitutions. Is it not over here? This one has a code generator. No, this one doesn't. And some of them, they'll actually have common patterns you need to search for. Definitely these, like a regex one, a reg, reg, I can't even say rex egg. That's a really good one. He has a ton of examples on how to find things. And that is a good example. Did I say don't grab Stack Overflow, regexes and dump them into your code? Did I mention that? Yeah, don't do that. At least without dumping it into one of these testers and reading the explanation. But also don't recreate the wheel, right? Like don't try to write your own complicated regx if somebody else has already built it, right? Just make sure you understand what it's doing. Any other questions for me? What's this set that you've made of this site? This site? It's regx101, regxer, regexr.com is also another really good one. They all do the same thing. Any other questions? Yes? Regx or regx? So it's regular expressions. I'm holding it for Jesus. Oh, sir. Oh, I've lost my, I'm sorry. But if you want to say regx, that's not gonna offend me. I just say regx because it's regular expressions. Though if you ask me about GIF and GIF, I am very hard on GIF side. It is GIF. We'll die on that hill. Any other questions? Any other questions? Yeah? What should anchors do in the beginning and the ending? Is there anything that you can cook out for just in the middle, not in the beginning, not in the end? There are off the top of my head, I could not tell you what there are. But there are other ways to designate positions inside. And usually you can often use those looker rounds to also narrow down where things are occurring. Off the top of my head, I couldn't tell you, I had to look it up. Any other questions? You get the bonus for stumping me. Yeah? I will definitely do that then. Any other questions? I'm gonna flip this back over. This is, oh, that's not what I want. There we go. That was questions. So that is my business card. If you'd like to scan it to get that information. But again, I'm Gilzo everywhere, right? Just search for Gilzo, you're gonna find me. If not me, it's gonna be a relative. We'll get you back to me, it's not a problem. I am gonna be here until Monday. So, you know, if you come up with a question that you didn't think of right now, grab me on the hallway. I mean, I literally do love regular expressions. I get very, very excited whenever my boss comes to me and says, hey, we need to build this thing. Like, yes! So definitely ask me questions. What part of the country are you in? I'm currently in Columbia, Missouri, which is pretty much through a dart in the middle of the States. It's, you're gonna land pretty close to me. But the company at Workforce Platform SH we're an international company. So I'm all over the world. We kind of go everywhere. Very cool, all right. If there's no other questions, thank you very much. I definitely appreciate it. And today everybody learned at least two new things. Yay, I accomplished my goal, perfect. Thank you very much.