Reputation: 171
I have this link html code:
<a href="/drupal-7.41/en/node/3" title="">Lorem Ipsum Dolor</a>
I need to replace the first space between the a tag with a <br />
So the result should look like: <a href="/drupal-7.41/en/node/3" title="">Lorem<br />Ipsum Dolor</a>
I tried something like (?:<.*">.*)(\s)
but without any success.
Upvotes: 0
Views: 61
Reputation: 23381
Try this way:
(<a[^>]*>)(.+?)(\s)(.+)(<\/a>)
And replace it by:
$1$2<br />$4$5
See it working here: https://regex101.com/r/sI4cI9/2
Upvotes: 1