4 ms·
Check out this StackExchange thread which provides many answers[1] The TL;DR is, RegEx behaves slightly differently in each programming language. For example,
by mmh0000 3y ago
Check out this StackExchange thread which provides many answers[1]
The TL;DR is, RegEx behaves slightly differently in each programming language. For example, if and how newlines are matched.
There are three main flavors of RegEx: POSIX, Extended, and PCRE. Most UNIX tools implement either POSIX or Extended. Most Programming languages implement PCRE. Some programs (/cough vim/) just make up their own regex langauge as they go.
[1] https://stackoverflow.com/questions/159118/how-do-i-match-any-character-across-multiple-lines-in-a-regular-expression https://stackoverflow.com/questions/159118/how-do-i-match-an...
- pcthrowaway 3y agoRight, I understand different regex flavors work differently; what I was questioning was whether the capture group negation syntax was any more "predictable" (for OP's concerns) than the `.` matching. Because the article recommends using a capture group negation to match a character when you know a specific character or set of characters won't be in the group, but doesn't mention why capture groups (and negations) are acceptable to use, while the `.` should be avoided ("because it might have this less predictable behaviour that I'm totally going to avoid talking about with capture group negations")
- satysin 3y agoHi mmh0000 apologies for replying like this but not long ago we had a little conversation regarding TRT. I replied to your last message but it is from a while ago and as HN doesn't alert you if you get a reply I've no idea if you read back through your older replies to see it. I was wondering if you had a bit of time to talk with me in private about TRT? I would be extremely grateful if you can and if so just drop me an email, my username satsyin at gmail will get to me. Thanks :)
- mmh0000 3y agoYes, please email me: mmh-hn-trt@xn0.org