Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Literal search option  
2 comments  




2 I must be really stupid  
1 comment  




3 Greediness  
1 comment  




4 Running bare insource:/regexp/ searches is not cool  
1 comment  













Template talk:Regex




Page contents not supported in other languages.  









Template
Talk
 

















Read
Edit
Add topic
View history
 








Tools
   


Actions  



Read
Edit
Add topic
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

(Redirected from Template talk:Regex/doc)

Literal search option[edit]

This template should feature an option for making the search literal. It would automatically quote all punctuation for the user. It might take an argument that is thousands of words long that was cut and paste from elsewhere, and quote the periods, and plus signs and all.

Couldn't hurt. Doesn't hurt to quote. CirrusSearch just ignores unnecessary quoting, and goes ahead and finds the character literally, no matter what else. — CpiralCpiral 18:52, 12 August 2015 (UTC)[reply]

Just use double quotes to escape all metacharacters: insource/"everything in here is literal because escaped, quoted even by virtue of the double quotes. Even every space, etc."/ Don't forget to use a filter beside it. — CpiralCpiral 07:48, 14 August 2015 (UTC)[reply]

I must be really stupid[edit]

But I want to perform a regex search on Wikipedia articles, and I keep finding policies and stuff. How do I actually just do a search to find all page titles matching, say, ^l.*s$? Why is this not obvious? Equinox 22:38, 12 March 2017 (UTC)[reply]

Greediness[edit]

No mention of * and + (non-)greediness. —Mykhal (talk) 12:25, 21 December 2017 (UTC)[reply]

Running bare insource:/regexp/ searches is not cool[edit]

See mw:Help:CirrusSearch#Boost-templates. Also, such requests are just many times slower and often time out.

Ideally, this template should add a insource:"..." part (without regexp) before the actual insource:/.../, as per the aforementioned link. But some character transformations would be needed to be done (remove \ that are used for character escaping etc.). JWBTH (talk) 14:55, 11 July 2023 (UTC)[reply]


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template_talk:Regex&oldid=1164862718"





This page was last edited on 11 July 2023, at 14:55 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki