Can you help with with this #Python #RegEx? https://pythex.org/?regex=SUMMARY%3A(%3FP%3Ctitle%3E.%2B%3F)(%3FP%3Ccomment%3E%20%5C(.%2B)%3F&test_string=SUMMARY%3Afoo%20bar%20(baz%20bonus)%0ASUMMARY%3Afoo%20bar&ignorecase=0&multiline=0&dotall=0&verbose=0
I expect the "title" to be "foo bar" in both example lines and the optional comment of the first example should be " (baz bonus)".
Any idea where I went wrong?
The comment part is greedy, the first non-greedy. Somehow, this only matches the first character of the title.
Edit: SOLUTION = https://pythex.org/?regex=SUMMARY%3A(%3FP%3Ctitle%3E.%2B%3F)(%3FP%3Ccomment%3E%20%5C(.%2B)%3F%24&test_string=SUMMARY%3Afoo%20bar%20(baz%20bonus)%0ASUMMARY%3Afoo%20bar&ignorecase=0&multiline=1&dotall=0&verbose=0 (I just added a "$" at the end ) with explanation https://graz.social/@blobster@infosec.exchange/113754002012126569
The Ultimate Quick Reference Commands & Shortcuts
Find a command or keyboard shortcut quickly and easily with these articles covering topics of Linux, Git, SQL, Pi-hole, regular expressions and more.
@i0null Regular Expletives!
https://chaos.social/@FlohEinstein/112994145288024263
#regex
Did you know that you can replace a regex with unicode character in Vim? When is it useful?
When mass formatting a text. Such as replacing all instances of {...} with {…}. Or all dashes with en-dash or em-dash.
:%s/\.\.\./\=nr2char(0x2026)/gc
nr2char() replaces the matched regex with the character represented by its unicode value.
@timbray has an interesting proposal for #escaping characters in #regex:
https://www.tbray.org/ongoing/When/202x/2024/09/22/Unbackslashing
I just finished another war against RegEx... Anyone else know the feeling?
#regex #infosec #development #programming #RegularExpressions
(Updated picture to make it say O RLY)
I just published a tool called smatch that I've wanted for a while now. A grep-like tool to do pattern matching on S-expressions (#lisp) using #regex-like syntax for trees.
It also has recursive patterns, so you can pattern match with patterns that look like grammars.
My end goal is to use them for #SMTLIB but it should still work for most lisps (clojure being an exception).
The code and an x86_64-linux static binary are here: https://github.com/geezee/smatch
On regexes, NFAs, and DFAs, and Thomson's speedy algorithm for matching.
#curl sometimes fails to access some servers. In most situations the problem is not in curl itself but on the server side. Example:
1. Fails: curl https://www.radissonhotels.com
2. Works: curl -A 'Mozilla/5.0 xx Chrome/119' https://www.radissonhotels.com
3. Fails: curl -A 'Mozilla/5.0 xx Chrome/118' https://www.radissonhotels.com
4. Fails, too: curl -A 'Mozilla/5.0 xx Chrome/1189' https://www.radissonhotels.com
Perhaps they perform #filtering to obtain improved #security? It's hard to tell, but any serious attacker surely knows how to spoof the user agent string and bypass such simple #regex
does there yet exist any application that can take a multi-selection and spit out a #regex that will match that in any file going forward?
Getting ready for the Decoder part, reviewing a few ways break up a String
https://www.whynotestflight.com/excuses/wait-how-do-i-scan-text-again/
The RegExBuilder regex is surprisingly speedy in context!
Unicopedia Plus is a developer-oriented set of Unicode, Unihan, Unikemet & emoji utilities wrapped into one single app, built with #Electron.
Repository: https://codeberg.org/tonton-pixel/unicopedia-plus