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

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...
 
Ive never actually been in a situation where it would help save me time. I have used it, purely to say hey ive 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, Ill 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! Theres 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 wont use Regex when its "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. Youre 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 its possible.

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

Well... thats it. Thats my point.
 
I use it only when necessary and more helpful that IndexOf and other string functions.
Theres not much that Ill 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