I prefer Gryphon, but ydy.
I prefer Gryphon, but ydy.
NOTE: this was originally published on the older version of this blog, some content may be broken/outdated.
Following a discussion on hacker news I have found myself wondering about regular expressions in ruby 1.9.
In this major version ruby switched its regex engine to oniguruma (and, since a few days ago to a fork of it called Onigmo ).
This engine is widely more powerful than the […]
https://riffraff.info/2012/02/matching-nested-structures-with-regexps-in-ruby-1-9/
Регулярные выражения в плагине «Аналитика» для Р7 офис
Если обычный человек посмотрит на исходный код программы, написанный на популярных языках вроде JavaScript или Python, то по контексту и знакомым словам он сможет понять, что происходит. Но регулярные выражения со стороны похожи на случайный набор символов – будто кошка прошла по клавиатуре. В этом случае даже код на Ассемблере выглядит более читаемым. Мы в « ЛАНИТ-Интеграции » не понаслышке знаем, как бывает сложно собрать воедино данные из нескольких источников, привести их к общему виду и создать на их основе единую таблицу с полным отчетом. Для решения этой задачи был создан плагин «Аналитика» для Р7-офис как инструмент автоматизации для выгрузки и обработки данных. В этой статье в блоге ЛАНИТ хочу рассказать вам о новых возможностях поиска данных в плагине в сочетании с функционалом RegExp (они же регулярные выражения или просто регулярки).
https://habr.com/ru/companies/lanit/articles/960568/
#ланит #ланитинтеграция #regex #regexp #регулярки #регулярные_выражения
You can't parse XML with regex. Let's do it anyways
https://sdomi.pl/weblog/26-nobody-here-is-free-of-sin/
#ycombinator #xml #regexp #parser #bash #html #xhtml #regular_expression
My tip of the of the day.
To match a literal dot "." with a regular expression, write
"[.]"
instead of
"\\." or "\\\\." or even "\\\\\\\\.",
depending on context. 😀
#regex #regexp #regularexpression #programming #stringmatching
Das wäre dann auch meine einzige Kritik an @emk s Ansatz: In #Lowmark finden sich viele reguläre Ausdrücke zum Parsen. Die sind aber schwer zugänglich. Ich versuche Parser meist ohne #RegExp zu schreiben. Das macht den Code deutlich länger, aber leichter zu verstehen.
正規表示式的先行斷言(lookahead)和後行斷言(lookbehind)
https://www.runoob.com/w3cnote/reg-lookahead-lookbehind.html
Чистим строку от лишних/повторяющихся пробелов (и пробельных символов) в строковых значениях компактно. RegExp
Хочу поделиться компактной функцией для очищения лишних, повторяющихся пробелов и пробельных символов в строках. Не считайте это призывом, но если можно привести строковые данные в красивый вид без лишних хлопот, то почему бы и не воспользоваться. Те, кто не знаком с регулярными выражениями (regular expressions, RegExp, regex), может приоткроет форточку в этот славный и замороченный мир ( Регулярные выражения (regexp) — основы )
https://habr.com/ru/articles/942568/
#regexp #excel #python #javascript #visual_basic_for_applications
Pythonの正規表現で特殊記号をすべて闇に葬り去りたいとき #regexp - Qiita
https://qiita.com/ganyariya/items/42fc0ed3dcebecb6b117
Whenever you use a regular expression to filter IP addresses, a kitten dies.
シークヮーサーとファイアーエムブレムの表記ゆれを正規表現で表す #regexp - Qiita
https://qiita.com/rsato/items/d804894b6b54003b9cb1
.* in #regexp search-and-replace is generally wrong. You have an example here: https://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard/Incidents#User:Bender_the_Bot_is_malfunctioning
Okay, let me reveal what's #hidden and how it is hidden, because the odds are that this post will fall into Internet oblivion anyways.
First, the #RegExp is very clear: replace occurrences from both "VOID" and "ZERO" with a "0":
"Lovely fire, darkness hideout. Jester I am: 0 innocence. A beast fought, instinctively awakened...
Defiant hunger, jokingly irradiating another 0 iridescence. Darkness hugs: Lady Fatale, a beautiful and angry blasting force. A wrathful lust, for I endlessly await being found inside a deadly hug: lemme go!"
Now, for each line, take every #acrostic (a.k.a. the initial letter), ignoring both the case and the punctuation:
L F D H J I A 0 I A B F I A
D H J I A 0 I D H L F A B A A B F A W L F I E A B F I A D H L G
Take the position from each letter (A=1, B=2, up to Z=26), except if it's zero, as zero means zero:
12 6 4 8 10 9 1 0 9 1 2 6 9 1
4 8 10 9 1 0 9 4 8 12 6 1 2 1 1 2 6 1 23 12 6 9 5 1 2 6 9 1 4 8 12 7
Now, the part which depends on knowledge from both #electronicengineering and #programming: from left to right, concatenating digits when needed, find which decimal (base-10) corresponds to a 7-segment display digit. For reference:
0=>126, 1=>48, 2=>109, 3=>121, 4=>51, 5=>91, 6=>95, 7=>112, 8=>127, 9=>123 (if you roughly feed one of these numbers from an #Arduino or #Raspberry to a 7-segment display, it'll display the digit you're referring to)
Let me do the first line:
12 6 4 8 10 9 1 0 9 1 2 6 9 1
126 (0), then 48 (1), then 109 (2), then 109 again (2), then 126 (0), then 91 (5).
So the first line results in 012205.
Now, notice how it's an even amount of digits, and how every 2n'th digit ranges from 0 to 2. It's on purpose: they mean pairs which mean a numeric position within the alphabet:
01 = A, 22 = V, 05 = E. It's "AVE".
Now you know how to decode the second line.
I don't have a name for this #cipher: AFAIK, it's a novel cipher. My point is not to invent something, or to seem/feel superior: my point is that everything can be turned into a ciphering method. For example, one can spell aircraft registration numbers that will map to their respective manufacturers (Cessna, Bombardier, Embraer, etc) and models, then to their acrostics to form a word. You can map letters to digits that, when read through a given numeric base (e.g. hexadecimal), will map back to other letters. Possibilities are infinite, literally infinite.
Check my other posts where there are other (fairly easier) ciphering methods, if you wish to see more like this...
RE: https://calckey.world/notes/ab42zffp0z
I just took the https://fstrings.wtf/ quiz. 18/26 without looking. TBH some of my errors were because I didn't know #Python well enough (I had barely used `:=` so far). But this is what you get when you introduce a recursive #regexp like language that becomes unreadable quickly. See also https://www.grulic.org.ar/~mdione/glob/posts/is-dinant-dead-or-a-tip-for-writing-regular-expressions/