Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\regex_show:N doesn't work with . #1093

Closed
eg9 opened this issue May 18, 2022 · 2 comments
Closed

\regex_show:N doesn't work with . #1093

eg9 opened this issue May 18, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eg9
Copy link
Contributor

eg9 commented May 18, 2022

If a period is inside a compiled regex, \regex_show:N doesn't work

\documentclass{article}

\ExplSyntaxOn
\regex_set:Nn \l_tmpa_regex {?}
\regex_show:N \l_tmpa_regex
\regex_set:Nn \l_tmpa_regex {.}
\regex_show:N \l_tmpa_regex
\regex_set:Nn \l_tmpa_regex {abc.}
\regex_show:N \l_tmpa_regex
\ExplSyntaxOff

\stop

Log file

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.5.8)  18 MAY 2022 18:06
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**reginv.tex
(./reginv.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-05-04>
(/usr/local/texlive/2022/texmf-dist/tex/latex/latexbug/latexbug.sty
Package: latexbug 2021/09/25 v1.0l Bug-classification
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
> Compiled regex variable \l_tmpa_regex:
+-branch
  char code 63 (?).
<recently read> }
                 
l.6 \regex_show:N \l_tmpa_regex
                               
? 

! LaTeX3 Error: Variable '\l_tmpa_regex' is not a valid regex.

For immediate help type H <return>.
 ...                                              
                                                  
l.8 \regex_show:N \l_tmpa_regex
                               
? 

! LaTeX3 Error: Variable '\l_tmpa_regex' is not a valid regex.

For immediate help type H <return>.
 ...                                              
                                                  
l.10 \regex_show:N \l_tmpa_regex
                                
? 
 ) 
Here is how much of TeX's memory you used:
 812 strings out of 478300
 15361 string characters out of 5845126
 308497 words of memory out of 5000000
 19076 multiletter control sequences out of 15000+600000
 469259 words of font info for 28 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 34i,1n,38p,163b,554s stack positions out of 10000i,1000n,20000p,200000b,200000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Source: https://tex.stackexchange.com/q/644686/4427

@eg9 eg9 assigned eg9 and blefloch and unassigned eg9 May 20, 2022
@eg9 eg9 added the bug Something isn't working label May 20, 2022
@josephwright
Copy link
Member

\regex_show:n has to 'know' about different possible implementation aspects, so this is likely just a missing one.

@blefloch
Copy link
Member

blefloch commented Jun 24, 2022

The difference between \regex_show:N and the n type is that the N type has some checking that the regex is not broken. But that checking is way too restrictive; it doesn't know about classes [a-z] or \d or . etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants