Like a regex, but readable?

Not to raise the ire of uncle_alice, but try as I might to read regex
tutorials, any sufficiently long regex pattern string is indistinguishable
from magic to me. It's unreadable.
So I'm wondering if code that step-by-step constructs a regex object,
without resorting to string symbols, would be more comprehensible?
Are there any example of this being done in any library? Or should I
just drink the Kool-Aid?

Actually, I agree: regexes cram too much meaning into too few characters, and end up looking like chicken scratch. Also, they were originally designed to match "regular" grammars (whatever they are), while we usually use them on non-regular grammars like natural languages, programming languages, HTML, etc.. Thanks to that impedence mismatch, some tasks that are conceptually simple are difficult to perform, if not impossible.
Trouble is, there's nothing else out there that's as powerful, general, and convenient as regexes. The only thing I know of that could completely replace regexes is a parser generator like Antlr or JavaCC, but those are way too heavy for most tasks. There are projects, like the two listed below, that try to make it easier to generate parsers, but they still lose out to regexes on the convenience front.
http://bnf-for-java.sourceforge.net/
http://jtopas.sourceforge.net/jtopas/index.html
I'm afraid the only thing that's going to be able to supplant regexes are better regexes, like the ones the Perl community is working on:
http://dev.perl.org/perl6/doc/design/syn/S05.html
But Ipthar help the schmuck who gets the job of shoehorning those into Java! ^_^

Similar Messages

  • Jonatan R. Aug 1, 2012 5:42 PM Hello, didnt really know hwere to post this guess it more belong under like "computers" generally,    but! For a while...        (-THE LONGER VERSION) : No whait!, let me start where it all began, 2009, a december (erhh.. ii

    Hello, didnt really know hwere to post this guess it more belong under like "computers" generally, 
    but! For a while... 
        (-THE LONGER VERSION) :
    No whait!, let me start where it all began, 2009, a december (erhh.. iii think? Hwatever!) litlle me hwere nearly Totally blank to the computer world. And suddenly it stood there on the table, a shining (it was shining back there) new "hp pavillion entertainment pc" with its smell of fresh plastic mixed hwith the strong smell from the cardboardbox, remember it as if it were yesterday
    ... Since then.... I have today a good solid pc knowing! (at more advance level cmd,bott menu, recovery, blah, blah... NERD!) here at the last awhile, ive prommised to make a lot! A lot of video projects!
    (okay 2, but some big ones!) avchd multilayer 2 hours!!!! 
    So the poor hp laptop -dual core i2 4gb ram, has been begged to it knees! And simply cant handle it of course! and it have just trough time benn loaded with lots of crap, and is extremly noisy, heat, slow, anoying = unusable!
    SO hwat i need is...
        (-THE SHORTER) :
    A computer setup that will EASILY! could handle stuff like that  (avchd, multilayer, 2 hours project) -and simmilar. A total power machine! But Im tired of windows! And ugly cheap looking design! The times have changed and i change with them!
    NOW I WANT APPLE!! 
    But but but... Hwat should i get????
    1. Im NOT a billionare!
    2. I repeat: NOT a billionare!
    3. I also need portability for every day use beyond the hardcore creative editing and use
    AT LAST:
     i saw in front of me this genius plan... With a macbook pro, a tuned one, with as much of ram,cpu,gpu, and everything else as it can posibble have
    -the perfect combination of transportabillity, everydayuse and total power!
    When it gets combine with,
    A cinemadisplay
    A extra keyboard
    And a extra magic mouse
    And this power macbook pro, with screen, mouse, and keyboard i've found a really good offer at.
    MY ACTUAL QUESTION.... :
    Now it is yours turn to please! be creative! Please! Hwat does all you genius heads! think and say?
    WILL A super tuned MACBBOK PRO COMBINED WITH ACCESSORIES, AT ALL, BE ABLE TO REPLACE A STRONG MAC PRO, OR AT LEAST BE MORE THAN ENOUGH FOR REALLY HEAVY STUFF? And if yes, HOW strong actually (ram,cpu,gpu...) will it need to have to be "more than enough"?
    If no, what would all of  you then suggest that is perfect in relation to everything?
    PLEASE ANSWER!!

    Jonatan R. wrote:
    WILL A super tuned MACBBOK PRO COMBINED WITH ACCESSORIES, AT ALL, BE ABLE TO REPLACE A STRONG MAC PRO,
    No,
    the MacPro is the muscle machine and not constrained by power or cooling limitations like the MacBoo Pro is.
    OR AT LEAST BE MORE THAN ENOUGH FOR REALLY HEAVY STUFF?
    If you press the MacBook Pro like a desktop machine, it will blow fans like a hurricane but will do the job eventually.
    The longer you blow fans on a laptop, the sooner it clogs up with crippling dust and shortens the life of the machine.
    You'll need the top end 15" or better, not the 13" as it has no dedicated graphics, only CPU graphics.
    Preferably if you just now getting into video, you should be considering Avid on a Windows 7 tower, it's because Apple has been ignoring the MacPro for hardware updates to improve it and it seems like they don't want to carry it anymore. Also the last Final Cut Pro version had Hollywood up in arms as Apple removed a lot of required abilities to make it more "consumer friendly" which upset the Pro market who likes control.
    Apple is focusing on the consumer computing market and getting away from the "Pro" market which needs the heavier hardware to handle video needs. They stopped selling the X-RAID and the X-Server, so Apple really isn't a "computer" company any longer.
    Sure you can use a MacBook Pro and a external monitor for doing home movies and such occasionally, but if your into serious production you need to consdier other options now.
    There is nothing wrong in getting a MacBook Air and a Windows 7 professional video tower too.

  • Need lightroom 4.4 asmac is 10.6.8 and not compatible with anything higher. Does this come with the creative cloud? Would really like a disc but that doesn't seem to happen anymore. Currently have cs4 and d7100 hence need 4.4 to open raw Any idea

    need lightroom 4.4 asmac is 10.6.8 and not compatible with anything higher. Does this come with the creative cloud? Would really like a disc but that doesn't seem to happen anymore. Currently have cs4 and d7100 hence need 4.4 to open raw Any ideas? Is this now customer service or does adobe have a customer service team . Site not user friendly. Thanks

    Graham Giles wrote:
    Have you seen this type of problem before? I think it could be a serious issue for anyone in a similar position.
    No; but then, I've not had occasion to use TDM. I've been using firerwire drives for over 10 years, both FW400 and FW800, with no issues except a bit of instability using a B&W G3 machine.
    TDM should be safe. Using cautious, manual copying of files from the Target machine to the Host machine should not result in unexpected loss of files or damage to the Target drive's directories. It should behave exactly the same as if it were an external (to the Host) firewire drive.
    •  I don't suppose there is anything I can do to 'put back' lost items from a separate Time Machine drive which has an up to date backup on it.
    There is probably a way to do that - seems to me that's one of the reasons for a Time Machine volume.
    On the other hand, if the Time Machine volume is rigidly linked to the now-absent OS on the original drive, there may be no way to effectively access the files in the TM archive.
    I know that using a cloned drive would work well in this instance.
    I have no experience with Time Machine, so perhaps someone who has will chime in with suggestions.
    With the machine in TDM with the other machine, have you tried running Disk Utility to see if you can effect repairs to the drive?

  • Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Do you have any restrictions for purchasing apps on the phone? Settings > General > Restrictions. If you have a Mac computer or another Apple device can you purchase things in the App Store using the same Apple ID on something else?

  • I have changed my PC and want to authorise it on itunes match, it looks like it has but still says i have 5 machines authorise

    i have changed my PC and want to authorise it on itunes match, it looks like it has but still says i have 5 machines authorise    

    Sign-in to your iTunes Account, you can see which computers are authorised.  If necessary de-authorise all and authorise those again that you need.

  • I downloader all the Adobe Presenter, looks like everything downloaded but when I open the program I get the following message: The file archive part of Presenter is missing. You need all parts in the same folder

    I downloadedall the Adobe Presenter, looks like everything downloaded but when I open the program I get the following message: The file archive part of Presenter is missing. You need all parts in the same folder

    HI There,
    It seems that Presenter is not fully downloaded. Please check you have downloaded .exe and .7z files successfully. In case you are still facing the issue then please click on the following link to chat with the support :  Chat
    with an Expert
    Regards,
    Mayank

  • Trying to download the new Black Ops app and when downloading it says I don't have enough storage space. I made sure I had 1.31 GB of space(like it requires)but it still says I don't have enough space. I even tried to delete more 2.5 GB (I have iPhone 4S)

    I was trying to download the new Black Ops (Strike Team) app and when I try to download it, it says I don't have enough storage space. I made sure I had 1.31 GB of space (like it requires) but it still says I don't have enough space. I even tried to delete more 2.5 GB (I have the iPhone 4S) and the app specifically says that is is compatable with iPhone 4S. I even tried rebooting the phone a couple times before downloading, but it still says the same thing.

    The app you are trying to download my be a zipped file and more space than 1.3GB.  go to settings/general/usage and delete what you no longer want to make more space

  • Recording Screen Activity As Video (Like a Grab, but in Video)?

    I know this can be done, we see it in all of the software tutorials and all. I just want to record some video of my screen as I run through some tasks, without pointing a video camera at my screen. How do you do this, just like a Grab, but rather than a still image, a movie, maybe even with audio recording from my built-in mic.
    Thanks.

    There are Mac keyboard strokes to capture stills or vid.
    I can't recall what they are. Pretty sure you can dig it up in the HELP list.
    Some one may chime in the info. If I get a bit of spare time later I'll check it out.
    Al

  • When I restart my Mac, the grey screen appears like usual. But it takes more than 40 minutes (more) for it to load to finish restarting the Mac. What should I do?!

    When I restart my Mac, the grey screen appears like usual. But it takes more than 40 minutes (or more) for it to load to finish restarting the Mac. What should I do to fix it?!

    Disconnect all devices from your computer if you have not already done so.  Restart again.  If the problem has been resolved, you had a peripheral conflict.  You will then have to reconnect the devices one at time, restart,  to locate the culprit.
    Login Items is another culprit.  Check your login items.
    System Preferences>Accounts>Login Items
    Delete/disable all you do not need or want.

  • Why wont my itunes open it acts like its loading but then it just never comes up

    itunes acts like its loading but never comes up and rarely when it does come up it freezes.

    Hello, jessykins25.
    Thank you for the question.  This sounds like you will need to rebuild your iTunes library file.  Below, I have included the article that walks you through this process.  Start with the section labeled Re-creating the iTunes Library file.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    Cheers,
    Jason H.

  • How can I use pdf pack to convert cubase documents  (music scores)  into pdfs? I am looking for the former possibility to install acrobat like a printer but i don't have this option with "pdf pack". Can you help?

    How can I use pdf pack to convert cubase documents  (music scores)  into pdfs? I am looking for the former possibility to install acrobat like a printer but i don't have this option with "pdf pack". Can you help?

    Hi mariab,
    What format are those music scores (I'm not familiar with cubase documents). But, it may be that Adobe PDF Pack doesn't support that format. In that case, Acrobat is the way to go. You can then print your files to PDF as you'd like. You're welcome to try Acrobat for free for 30 days to see whether it's going to work for you. If you decide it is, and you'd like to use it going forward, you could convert your PDF Pack subscription into an Acrobat subscription.
    Best,
    Sara

  • I have been using Macromedia Contribute 3 to maintain my website so my needs are pretty simmple. But I would like to upgrade but don't know what to download. I want the new software to handle my existing website without a lot of challenges. What do you re

    I have been using Macromedia Contribute 3 to maintain my website so my needs are pretty simple. But I would like to upgrade but don't know what to download. I want the new software to handle my existing website without a lot of challenges. What do you recommend?

    Hello,
    There is no upgrade path available from Macromedia Contribute 3 to Adobe Contribute 6.5. However you can buy the latest version of Contribute which is 6.5 from the link mentioned below.
    http://www.adobe.com/products/contribute.html
    Regards,
    Rajeev

  • HT3743 I purchased an iphone 3g that was to be open to any carrier, I went to restore it to my itunes account and get a 1015 error, can this be fixed.  I am new to the iphone and like the product but cannot buy new.  Please help. THANKS

    I purchased an iphone 3g that was to be open to any carrier, I went to restore it to my itunes account and get a 1015 error, can this be fixed.  I am new to the iphone and like the product but cannot buy new.  Please help. THANKS

    You got ripped off. You bought a hacked/jailbroken phone. That's what error 1015 means. Return it and get your money back if possible and buy a phone from a legitimate source.
    Discussing jailbroken / hacked phones is forbidden by the terms of service. Jailbreaking / hacking voids any warranty and forfeits your right to support here or from Apple. You can not get help here.

  • I got a Iphone 4S internet like free(UNLOCK) but is not... This Iphone is lock with Orange (SPAIN) How can I unlock the Iphone now¿?

    I got a Iphone 4S internet like free(UNLOCK) but is not... This Iphone is lock with Orange (SPAIN) How can I unlock the Iphone now¿?

    "Ok, but Whats happen if the carrier said that I need the first contract personal information.."
    Then you need the first contract personal information.
    " I Know that all the companys have to unlock de phone... ¿?¿?"
    Not true.
    "Apple could help me then¿?¿? unlocking the Iphone beacuse Apple always have the last word...
    No.  Apple has no part in the decision ot lock or unlock at all.  Lock/unlock is 100% the decision of the carrier.  Apple has nothing to do with this decision.

  • I am currently in my free trial of photoshop elements. I would like to purchase but Im using a computer now that i will not be using in a few months. How would I get that to transfer over? Thanks,

    I am currently in my free trial of photoshop elements. I would like to purchase but Im using a computer now that i will not be using in a few months. How would I get that to transfer over? Thanks,

    Hi Jtomanek,
    Open the Editor on your old PC and on the menu bar click Help and Deactivate or Sign out.
    Thanks & Regards,
    Sanjeeta

Maybe you are looking for

  • My Macbook Pro keeps freezing and crashing, several times a day

    Since I got my computer, it has been freezing. The little pinwheel will come up and nothing will work. It used to go away and my computer was usable again, and now I have to force shut my computer down by holding the power button down and turning it

  • URLConnection for Excel file

    Hi All, I'm trying to download and save an Excel file using URLConnection. The below code works and I can open the resulting file in Excel. However, the resulting file is about twice the size of the same file downloaded though the browser. Also, I ca

  • Czech characters not visible in TOAD

    Hello, I cannot see these special czech characters when use TOAD but yes when use SQL Developer. In database settings are==>SELECT * from NLS_database_PARAMETERS: *NLS_NCHAR_CHARACTERSET==>AL16UTF16 *NLS_LANGUAGE==>GERMAN *NLS_CHARACTERSET==>WE8MSWIN

  • Sample schemas, use of later version of ApEx

    I am very glad to read of the expanded capacities in this new release. 1. Will it come with the sample schemas to which we are now accustomed (SCOTT,HR,OE,etc)? 2. If I iinstall a later version of ApEx have the same effects on the XE 11 admin UI as i

  • "Bookmark all tabs" has quit allowing save to Bookmarks Menu

    Firefox 10.0, Windows 7 Ultimate. When I select "BAT", I get a title bar for "New Bookmarks" - just a title bar. If I expand it, I see a dialogue window for Name, Location, etc. but my existing Bookmarks Menu is not an option. This isn't a problem on