Solved

C# Regex

Posted on 2013-01-18
2
265 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
ID: 38793712
\[(.|\n)+?\]
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38794463
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

789 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