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

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:

  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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