• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

C# Regex

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
naelyan
Asked:
naelyan
1 Solution
 
Paul JacksonCommented:
\[(.|\n)+?\]
0
 
käµfm³d 👽Commented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now