I have a string (())(("I am) a(. text"((((
I need to break it down to three parts:
The first group should include anything that is not a \w
or \d
or "
or '
. BUT ALSO should be at the start of the string.
The second group should be literally any characters before group 3
The third group should be as the first group but AT THE END of the string
So the groups of the string above should look like this:
1. (())((
2. "I am) a(. text"
3. ((((
I have tried to do it like this: ^([^\w\d'\"]*)(.+)([^\w\d'\"]*)$
But the thing is (.+)
just eates everything...
I understand that my regex is wrong, but I have no idea how to do what I want to do