Structured Chat Output Parser doesn't work when model outputs a code block with ``` around the code block
Labels: name: area: agent, name: auto:bug

### System Info

langchain==0.0.351
python==3.10


### Who can help?

@hwchase17 This should be an easy one to fix.
When using regex in the output parser of the StructuredChatAgent, the output parser cuts off the output at the first ending ``` it finds. For example, if my string was 

```
"""```json
{
  "action": "Final Answer",
  "action_input": "Here is some basic Oceananigans code that sets up a simple simulation environment:\n\n```julia\nusing Oceananigans\n\n# Define the grid\ngrid = RectilinearGrid(size=(64, 64, 64), extent=(1, 1, 1))\n\n# Create a nonhydrostatic model\nmodel = NonhydrostaticModel(grid=grid)\n\n# The model is now ready for further configuration and running a simulation.\n```\n\nThis code initializes a `NonhydrostaticModel` on a 64x64x64 `RectilinearGrid` with an extent of 1x1x1 in each direction. The model is created with default settings, which you can customize according to your simulation needs."
}
```"""
```
Then the output parser would get """```json
{
  "action": "Final Answer",
  "action_input": "Here is some basic Oceananigans code that sets up a simple simulation environment:\n\n```julia\nusing Oceananigans\n\n# Define the grid\ngrid = RectilinearGrid(size=(64, 64, 64), extent=(1, 1, 1))\n\n# Create a nonhydrostatic model\nmodel = NonhydrostaticModel(grid=grid)\n\n# The model is now ready for further configuration and running a simulation.\n``` 
  
  which would cause an error.
  
  I have not throughly verified this solution but changing the regex in the structured chat output parser  - 
 https://github.com/langchain-ai/langchain/blob/aad3d8bd47d7f5598156ff2bdcc8f736f24a7412/libs/langchain/langchain/agents/structured_chat/output_parser.py#L23
 
 to pattern = re.compile(r"```json\s*\n(.*?)```(?=\s*```json|\Z)", re.DOTALL) seems to fix the problem.

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [X] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

pattern = re.compile(r"```(?:json\s+)?(\W.*?)```", re.DOTALL)
text="""```json
{
  "action": "Final Answer",
  "action_input": "Here is some basic Oceananigans code that sets up a simple simulation environment:\n\n```julia\nusing Oceananigans\n\n# Define the grid\ngrid = RectilinearGrid(size=(64, 64, 64), extent=(1, 1, 1))\n\n# Create a nonhydrostatic model\nmodel = NonhydrostaticModel(grid=grid)\n\n# The model is now ready for further configuration and running a simulation.\n```\n\nThis code initializes a `NonhydrostaticModel` on a 64x64x64 `RectilinearGrid` with an extent of 1x1x1 in each direction. The model is created with default settings, which you can customize according to your simulation needs."
}
```"""
action_match = pattern.search(text)
response = json.loads(action_match.group(1).strip(), strict=False)

### Expected behavior

I would expect the code to get the entire json blob block but it doesn't.