A programmer who hates coming up with regular expressions has produced a visual tool for automatically generating them. You paste in a block of text, identify the parts of it you'd like your regexp to catch, and it produces an (admittedly inelegant but absolutely functional) regexp ready for your use. The programmer explains, "It's free because I have been helped in my career so much by the programmers who generated free systems like linux, apache, php and mysql - this is the only free labour that I have ever given back to the community."
So what does txt2re do?
This system acts as a regular expression generator. Instead of trying to build the regular expression, you start off with the string that you want to search. You paste this into the site, click submit and the site finds recognisable patterns in your string. You then select the patterns that you are interested in and it writes a fully fledged program that extracts those patterns from that string. You then copy the program into your editor or IDE and play with it to integrate it into your program.
Thats appalling - where's the subtlety and art of crafting a beautiful regular expression in that?
There is none.
Alex Wood is an addict but won’t give up his smartphone. But he has five strategies for limiting its control over him: “I used to wake up tired. My body would ache and my head felt sore, like waking up with a hangover. Finally, I took control, like attending an AA class for addicts, I […]
Ok, it’s not just solar powered. It’s also an anti-theft, waterproof marvel that keeps my phone’s power bar from ever getting into the red.Sure the idea seems obvious now – tuck a gigantic solar powered battery pack into an exposed slot and turn the wearer into a walking energy harvester. Simple maybe, but I didn’t […]
Custom coffee vessels are the perfect piece of office flair, but it’s just a matter of time before your VOTE FOR PEDRO mug will start to lose its relevant wit. Why not have a new one every day, with whatever silly nonsense you want sticking off the sides? You can save big on your novelty […]
The Lightning port has thus far resisted the cruel fate that befell the headphone jack, and despite rumors that it may be disappearing come iPhone 8, for the present and foreseeable future, Lightning cables are a hot commodity for iPhone users. As such, we must make do in this strange time in which long, glorified […]
All the filters in the world won’t save your smartphone pics from a shaky hand. To really step up your mobile photography game, you’ll need some kind of mount to hold it steady. You could buy a smartphone attachment for a conventional camera tripod, but who wants to carry that kind of gear everywhere they […]