Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is it possible to use wildcard characters in TeXworks when you search for something? I can see that there is a "Regular expression" option, but I was thinking along the lines of something more user friendly.

My Example where for instance * would be the wildcard character: Searching for something like \setcounter{subsection}{*L1} would ideally return all of the following from my code using such functions.

  • \setcounter{subsection}{3}\subsection{}\writeVerseParams{40001004}{ypos}{F}{L1}
  • \setcounter{subsection}{4}\subsection{}\writeVerseParams{40001005}{ypos}{F}{L1}
  • \setcounter{subsection}{5}\subsection{}\writeVerseParams{40001006}{ypos}{F}{L1}
  • etc...
share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Quoting from the TeXworks manual

. (dot) This matches any character (including newline). So if you want to match the dot, you have to escape it \..

But probably you want to match anything except a newline, so [^\n] is what you're looking for:

\\setcounter\{subsection\}\{[^\n]*L1\}
share|improve this answer
    
Good stuff. It works as expected. –  McGafter Jul 24 '13 at 14:28
add comment

It appears the answer is essentially NO.

Some good regular expression explanations can be found here. However for some reason it doesn't work properly on my TeXworks on my Mac...hmmmmmmmmm...

From what I can tell, my example should be able to work with a RegExp such as: \\setcounter\{subsection\}\{.*L1\} but doesn't.

EDIT:

See the accepted answer for solution to this regexp as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.