Jump to content
Xtreme .Net Talk

Have you ever use Regular Expression ?  

13 members have voted

  1. 1. Have you ever use Regular Expression ?

    • Yes, as much as possible
      1
    • Yes, but only when it's needed
      8
    • I rather make a 200 lines string analysis function than use that
      2
    • No, never
      2
    • Regular Expression ? Is it you new dog name ?
      0


Recommended Posts

Posted
Do you use it ? How often ? Do you try to avoid it ?

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted
Personnally... I use it for HTML analysis. It's powerful to the bone.

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted
I must admit... it's not easy to learn. But the power of this tool is well rewarded (up to my knowledge limit)

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted
I've never actually been in a situation where it would help save me time. I have used it, purely to say 'hey i've done that' - but it would of probably been quicker and easier not too in this situation.
  • *Experts*
Posted

I would/do use it whenever I have to split any string and I expect more than two pieces. If I just have two pieces, I'll use IndexOf. I like the readability of the named groups in a regular expresion.

 

I also use it for validation of strings, if needed. My company uses it this way and I love it! There's custom code to do the actual validation, but to define a new "datatype" for a DataSet column we use regular expressions (when needed of course).

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Yeah I agree with you. I won't use Regex when it's "abusive" if you know what I mean...

 

Using a regex while you can use a IndexOf is like trying to kill a fly with a bazooka. You're using a powerful tool to make a light job that would need only 1 function.

 

Like I said before... I had (1 weeks or 2 ago) to get all the content of all href in a web page. I could have done that with IndexOf but... what a mess it would have taked... I would have made a custom function and it would have taked me 5 minutes more.

 

I must admit that I took about 3 or 4 hours to learn as much as possible about RegEx. So all this work was maybe painful... but how much rewarding ? I know a little bit about RegEx and I really enjoy using it when it's possible.

 

Think about it... it's a tool that is already done and is working. What are you asking for ? Okay... it's a little hard to understand if you didn't even touch to that... but once you made 1 or 2 expression on your own... well... you're rewarded ! Because RegEx isn't only used by Microsoft. RegEx can also be used in PHP and many more language.

 

Well... that's it. That's my point.

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

  • Leaders
Posted

I use it only when necessary and more helpful that IndexOf and other string functions.

There's not much that I'll have to use it for in making games and other supplemental tools... I try to save all of my regular expressions because it takes so long (for me) to get a working one. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

  • 2 weeks later...
Posted
LOLLLLL..... well... I haven't predicted that !!!!!! LOLLLLLLLLLLLL

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

Why do you hate them ? I know they are kinda complex to use but... they are so powerful...

 

Could you tell me more ?

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...