TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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:

share|improve this answer
Good stuff. It works as expected. – McGafter Jul 24 '13 at 14:28

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.


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

share|improve this answer

Your Answer


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.