Regular Expressions 101

Community Patterns

Find C# Namespace

1

Regular Expression
ECMAScript (JavaScript)

/
(^namespace{1}.*\W\n?{)
/
gm

Description

Simple regex to find the Namespace line in a C# class.

Submitted by Erik Bartlow - 8 years ago