I have a document I am trying to parse with Java Regex and in it appears text in quotes either “”” or ”’ so you have:
“”” Bla, you’re not very nice! “””
or:
”’ Bla, this 1 isn’t a great example ”’
I have been trying along the lines of ["""|''']([\p{Alnum}|\p{Blank}]+)[\"""|''']
Assumptions:
The text will start and end with either “”” or ”’
The text could include numbers, letter, blanks and punctuation
The body of the text will not include the sequence of three ” or three ‘
Try this pattern:
("""|''').*?\1Given:
It will match:
"""Hello, World!"""""" lorem ipsum ''" dolor """'''single quotes'''''' Bla, this 1 isn't a great example '''You can also probably be more specific than
.*?but I wasn’t sure what characters you meant by “punctuation”.