Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: BuckeyeTexan

Regex can get pretty tricky if you are not careful. I always try to test the results with a online regex tester and a series of test data, of both desired includes and desired excludes. I’m often surprised of what sneaks through in both cases.....


14 posted on 10/31/2011 1:21:14 PM PDT by Lazamataz (I guess some Occupiers are more 99% than other Occupiers.)
[ Post Reply | Private Reply | To 12 | View Replies ]


To: Lazamataz
Regex is for cheaters. Nested if loops are the way to go! If you don't have to scroll to the right to see the beginning of your indentation you're not trying hard enough!

j/k. Back when I programmed a lot of Perl (~8 years ago) I used a lot of regex. Not sure how any real programmer could mistake \s for .* unless it was just an oversight or mistype that wasn't checked. But noone would think, "whitespace" and type ".*" (aka anything and everything)

18 posted on 10/31/2011 1:32:42 PM PDT by douginthearmy
[ Post Reply | Private Reply | To 14 | View Replies ]

To: Lazamataz

Agreed. I’ve been writing regex for 20 years and I still surprise myself with undesired results. It’s the nature of the beast.


29 posted on 10/31/2011 2:45:42 PM PDT by BuckeyeTexan (Man is not free unless government is limited. ~Ronald Reagan)
[ Post Reply | Private Reply | To 14 | View Replies ]

To: Lazamataz; BuckeyeTexan; douginthearmy

Any of you guys ever have Regex insert new words that weren’t in the text originally?


30 posted on 10/31/2011 2:58:54 PM PDT by butterdezillion
[ Post Reply | Private Reply | To 14 | View Replies ]

To: Lazamataz

>Regex can get pretty tricky if you are not careful. I always try to test the results with a online regex tester and a series of test data, of both desired includes and desired excludes. I’m often surprised of what sneaks through in both cases.....

I generally hate regex; there’s always some odd-case that totally breaks it, and they’ll break utterly if there’s a change in the structure and they’re anything more complex than “remove the whitespace” or “remove everything that’s not a digit.” Then there’s always the possibility that you’ll suddenly need (due to the client saying something) balanced parentheses...

I think I’d rather learn SNOBOL than spend the effort to gain any sort of ‘mastery’ over them.


50 posted on 10/31/2011 6:58:11 PM PDT by OneWingedShark (Q: Why am I here? A: To do Justly, to love mercy, and to walk humbly with my God.)
[ Post Reply | Private Reply | To 14 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson