I don’t know regular expression at all. Can anybody help me with one very simple regular expression which is,
extracting ‘word:word‘ from a sentence. e.g “Java Tutorial Format:Pdf With Location:Tokyo Javascript”?
- Little modification:
the first ‘word’ is from a list but second is anything. “word1 in [ABC, FGR, HTY]” - guys situation demands a little more
modification.
The matching form can be “word11:word12 word13 .. ” till the next “word21: … ” .
things are becoming complex with sec…..i have to learn reg ex 🙁
thanks in advance.
You can use the regex:
Explanation:
\w– single char which is either a letter(uppercase or lowercase), digit or a _.\w+– one or more of above char..basically a wordso
\w+:\w+would match a pair of words separated by a colon.