x Hint: Register, if you want to hide ads.
x Did you like it? Well, then please consider making a donation :)


Length: 0b, Line: 1, Cursor: 0

RegexOptions

IsMatch=true

Result

text1 (text2) text3 text1 (text2) text3 text1 (text2) text3

Share (without adding to database):

Source code

0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
//.NET Regex.Replace Online Tester: www.systemtextregularexpressions.com

//Namespace
using System.Text.RegularExpressions;

//Regex Pattern
string pattern = @"\s*\((.*)\)\s*";

//Regex example #1
Regex r = new Regex(@"\s*\((.*)\)\s*", RegexOptions.IgnorePatternWhitespace);
string result1 = r.Replace("input text", "replacement text");

//Regex example #2
string result2 = Regex.Replace("input text", @"\s*\((.*)\)\s*", "replacement text", RegexOptions.IgnorePatternWhitespace);
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
'.NET Regex.Replace Online Tester: www.systemtextregularexpressions.com

'Namespace
Imports System.Text.RegularExpressions

'Regex Pattern
Dim pattern As String = "\s*\((.*)\)\s*"

'Regex example #1
Dim r As Regex = New Regex("\s*\((.*)\)\s*", RegexOptions.IgnorePatternWhitespace)
Dim result1 As String = r.Replace("input text", "replacement text")

'Regex example #2
Dim result2 As String = Regex.Replace("input text", "\s*\((.*)\)\s*", "replacement text", RegexOptions.IgnorePatternWhitespace)