DXRW4E Posted December 31, 2013 Share Posted December 31, 2013 (edited) That's very difficult to read to me and requires a bit of thinking to figure out its logic. I'm not saying its bad or wrong, just a bit complicated looking. Is all OK, however is only this '(?:[^;"''\r\n]|''[^''\r\n]*''|"[^"\r\n]*")*' is the ABC of regex the first thing that you see all over the web '(?:[^"]|"[^"]*")*' I was referring to thisthe example above refers to read the string into quotes, for this is a bit more complicated Ciao. Edited December 31, 2013 by DXRW4E Link to comment Share on other sites More sharing options...
jchd Posted January 1, 2014 Share Posted January 1, 2014 Ascend4nt, Although I still hope future versions of PCRE add the ability to search for anything not-of-a-capture-group back.. I was about posting a question about this point on the PCRE list but before I'd like to come up with a real-world example where such a feature is useful. If you have a captured group, then want to skip until that group, that means that you expect to see that again, so tell the engine you want to match that. (abc|def) .*? \g-1 matches abcXXXXXX YYYYYYabc If you're not so sure that the group reappears, make it optional: (abc|def) .*? \g-1? matches abcXXXXXX YYYYYYabc and abcXXXXXX YYYYYY From this point of view I don't have an example of a situation where a back-ref to a group would be needed in a class. Can anyone surprise me? Of course if you want to match a different final boundary you can still use a reference to subroutine: (abc|def) .*? (?-1) matches abcXXXXXX YYYYYYabc and abcXXXXXX YYYYYYdef (and other combinations) This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Ascend4nt Posted January 2, 2014 Share Posted January 2, 2014 jchd, hmm.. good question. I was thinking about the possiblity of using that to detect duplicate things like 'patient_id = 124ab' but there are other means to do that. And from a few trials with the old engine it seems like the feature was actually broken, as it skipped over the captured groups in most cases. Oh, and oddly it seems to require curly braces for backreferences g{-1} and I swore in one case I had to use it with an absolute number even if followed by a bracket. Overall I suppose its not something to pester them about (unless its deviating from a Posix standard?). The 'detect duplicates' thought I had can be solved with lookahead and lookbehind assertions. And as you point out, if we're looking for a specific group to reappear we have other tools at our disposal. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
jchd Posted January 2, 2014 Share Posted January 2, 2014 I asked the question on the pcre list and I'll keep you informed of the outcome. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now