Solved

C# Regex

Posted on 2013-01-18
2
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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