Really simple situation:
Eg. in this string:
my dog said "woof" today
I would like to get the string in quotes, but without the quotes...
--- more detail ---
Unfortunately the regex is via 3rd party software so I don't know the underlying engi开发者_如何学Pythonne.
Here's the string:
href="http://pagingdrgupta.blogs.cnn.com/2010/08/17/dengue-fever-increases-in-florida/?hpt=T2">Dengue outbreak
Current regex:
(https?://)?([-\w]+(\.\w[-\w]*)+|([a-z0-9]([-a-z0-9]*[a-z0-9])?\.))+(com|edu|biz|gov|in(t|fo)|mil|net|org|[a-z][a-z]\.[a-z][a-z])\S*)
this returns:
http:.../?hpt=T2">Dengue
Adding "
to start and end of regex works, but includes the "
.
Perhaps there's another way?
This is going to depend on the "flavour" of regex that you are using. If your regex engine supports lookarounds (positive lookbehind, positive lookahead, negative lookbehind, and negative lookahead), you can do this.
The syntax also varies by flavour, so if you edit your question and/or tags to show what language you're working in, you can get a more specific answer.
精彩评论