Hello all. I've learned a bit about regular expressions today. I have a string formatted like "CN=foo,OU=bar,O=pah" and I need to parse out "foo". I have created the following code which does work: $dnvalue =~ m/([^,]*)/; $username = $1; $username =~ s/(CN=)//; print $username However, I'd like to do the match/replace on a single line. Can anyone show me how to combine these statements into a more elegant regular expression? Thanks, Mike
- Re: simple regex question Mike Ring
- Re: simple regex question Paul
- RE: simple regex question John Edwards
- RE: simple regex question John Edwards
- Simple regex question Rob Lee
- Re: Simple regex question Jenda Krynicky
- Re: Simple regex question bob ackerman
- Re: Simple regex question Jenda Krynicky
- Re: Simple regex question bob ackerman
- Re: Simple regex question Jenda Krynicky
- Re: Simple regex question bob ackerman