53 people want to...

learn regular expressions


 

People doing this are also doing these things:

Entries

abrari loves her mum :-)

Untitled 2 weeks ago

So when I’m at work I sometimes hear, “oh you’ll like this, it accepts regular expressions,” and everyone goes “whooooo!” and I think “oh yeah, great… yeah … I don’t know regular expressions.”



I wouldn't do without them 2 years ago

This is one skill that I am constantly using at work. I refuse to work with editors that don’t give me immediate access to regex.



Regex::Common 2 years ago

Check out CPAN for the Perl module called Regex::Common. It has pre-built regexes for many common things so that you don’t have to bang your head against the wall.

http://search.cpan.org/dist/Regexp-Common/

e.g: # we require that $replacement be JUST a valid IP address
die “Invalid IP address provided: [$replacement]”
unless $replacement =~ m/^$RE{net}{IPv4}$/;



Untitled 3 years ago

I can’t believe I went for some eight years without knowing these existed. Now that I’ve learned it, there’s rarely a day that I don’t use it.



Going to happen 3 years ago

I’m taking a Unix Topics course at the university and the class will spend about 2 weeks learning regular expressions. I don’t expect to master them in that time, but I will probably want to later on. Once I get a basic understanding of them, I anticipate learning more on my own.



another excellent site 3 years ago

http://www.wilsonmar.com/1regex.htm

There are a lot of good examples, like matching IP addresses and MAC addresses.



Untitled 3 years ago

Now I feel like I am a level higher than my programming mates!



Regex Library 3 years ago

I found a website listing a large number of common regex patterns:

regexlib



guide and example 3 years ago

First, I read this guide.

Next, here’s an example to puzzle over:

sentence.gsub( /\([-\w]+\)/, ’’ )

This example will find the literal parens characters with one or more words in between and replace them with nothing.



Untitled 3 years ago

The trick is to remember that they’re not confusing as long as you don’t think about them. Once you start thinking about them they get confusing. Just take a step back and try not to rack your brain.

$line =~ s/\027-\036\004-\025\376\377//gi;
maybe if i ignore it it will go away…
(if i have my head on straight, this replaces several nonprintable charachters with nothingness)

edit: http://www.weitz.de/regex-coach/ <—made of pure awesome



See all 39 entries

 

I want to:
43 Things Login