Google Search: find file extension with regex in c#

I have had a search to my page where I know the reader probably didn’t find what they were looking for.This post is to hopefully let that user find the information that they are looking for better.The Search term was “find file extension with regex in c#”.A simple regex that could be used in C# to find file extensions is:.+.([^.]+)$This will find an extension that is at the end of the string.


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

<p>I have had a search to my page where I know the reader probably didn't find what they were looking for.<p />This post is to hopefully let that user find the information that they are looking for better.<p />The Search term was "find file extension with regex in c#".<p />A simple regex that could be used in C# to find file extensions is:<p />.+.([^.]+)$<p />This will find an extension that is at the end of the string. To find an extension anywhere in a string you can use:<p />.+.([^.]+)\s<p />A regex to find a three letter extension at the end of a line:<p />.+.([^.]{3})$<p />To find a three letter extension anywhere in a string you can use:<p />.+.([^.]{3})\s<p /></p>


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2006-03-08T00:00:00+00:00) Google Search: find file extension with regex in c#. Retrieved from https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/

MLA
" » Google Search: find file extension with regex in c#." Paul Kinlan | Sciencx - Wednesday March 8, 2006, https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/
HARVARD
Paul Kinlan | Sciencx Wednesday March 8, 2006 » Google Search: find file extension with regex in c#., viewed ,<https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/>
VANCOUVER
Paul Kinlan | Sciencx - » Google Search: find file extension with regex in c#. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/
CHICAGO
" » Google Search: find file extension with regex in c#." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/
IEEE
" » Google Search: find file extension with regex in c#." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/. [Accessed: ]
rf:citation
» Google Search: find file extension with regex in c# | Paul Kinlan | Sciencx | https://www.scien.cx/2006/03/08/google-search-find-file-extension-with-regex-in-c/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.