Gary "grim" Kramlich<p>They say when you use regex you have two problems. I tend to have one less problem...</p><p>Case in point, here's a tokenizer for <a href="https://www.rfc-editor.org/rfc/rfc5801.html#section-4" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">rfc-editor.org/rfc/rfc5801.htm</span><span class="invisible">l#section-4</span></a>.</p><p>^(?:(?P<nonstd>F),)?(?P<cb>[npy])(?:=(?P<cbname>[^,]+))?,(?:a=(?P<authzid>[^,]+))?,</p><p>Validation still has to be done in the application, but this is still way easier than writing and maintaining a lexer.</p><p><a href="https://mastodon.social/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a> <a href="https://mastodon.social/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://mastodon.social/tags/development" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>development</span></a> <a href="https://mastodon.social/tags/rfc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rfc</span></a></p>