Reputation: 39
I have a string like 'String start &st This is the line > remaining'. I want a regex to find sub string starting from &st and ends with > including these like &st This is the line > I tried this
(?<=&st).*?(?=>)
But this does not include the start and end specified (Here &st and >) Any idea on this? I am using this in Visual basic.
Upvotes: 0
Views: 35
Reputation: 521279
Just include the lookround content in your pattern:
(&st.*?>)
If, for some reason, you really needed to use lookarounds, you can rework what you originally had:
(?=&st).*?(?<=>)
Upvotes: 1