Have you ever used Regular Expression ? (Regex is his little name)

Have you ever use Regular Expression ?

  • Yes, as much as possible

    Votes: 1 7.7%
  • Yes, but only when it's needed

    Votes: 8 61.5%
  • I rather make a 200 lines string analysis function than use that

    Votes: 2 15.4%
  • No, never

    Votes: 2 15.4%
  • Regular Expression ? Is it you new dog name ?

    Votes: 0 0.0%

  • Total voters
    13
I try to use them when ever I need to parse big strings (anything over 1000 chars). I am not very good at using them, but every attempt helps...
 
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.
 
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
 
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.
 
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. :)
 
Back
Top