I'm reallllly new to regex and I need some help. I tried figuring out myself but had no luck!
I am trying to select text between 2 strings (character for the last string)
ie:
word word2 :
I am trying to select "word2" between word and :
thanks!
$ means "Match the end of the string" (the position after the last character in the string). Both are called anchors and ensure that the entire string is matched instead of just a substring.
(? i) makes the regex case insensitive. (? c) makes the regex case sensitive.
Using regex \B-\B matches - between the word color - coded . Using \b-\b on the other hand matches the - in nine-digit and pass-key .
another alternative is to use this pattern
(?<=word\s).*(?=\s:)
See Lookahead and Lookbehind Zero-Width Assertions
/word (.*?) \:/
this should do the trick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With