Solved

C# Regex

Posted on 2013-01-18
2
261 Views
Last Modified: 2013-01-19
Hi guys,

I need a regular expression than matches a string which starts with an [ any text in between and ends in an ]. Regular expressions aren't my strong suit. Someone helped be before to detect text with square brackets and I thought I'd be able to modify this to suit the new purpose but not having any joy. Thanks in advance.
0
Comment
Question by:naelyan
2 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
Comment Utility
\[(.|\n)+?\]
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
Based on "matches a string which starts with an [" and "ends in an ]," it sounds like jacko2's pattern should be modified to:

^\[(.|\n)+?\]$

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now