softqert.blogg.se

Postgresql regex
Postgresql regex




postgresql regex

I ended up writing a small plpgsql function to get it right. The board can be in any order, you'll have to exclude the straight on board and the A-high or -low four straights. John whiskyjohn Posts: 248 Joined: Fri 4:12 pmīillGatesIII wrote:How do you write a regular expression for an open ended four straight? It seems a lot more difficult than the one for the four flush.

postgresql regex

Writing out all the possible permutations without regular expression lookaheads is probably a nightmare ofĬonditions that I did not want to tackle, even though it would be faster than parsing the regular expression itself. Similarly, if IĪnyway, I wrote a regular expression to match and not match open-ended 4-straights on board, in any order. The "is not null" properly returns matching patterns, but the "is null" returns nothing. I can enable logging but I don't see any useful I'm still not sure if it is possible to use that function for negation. On one of these threads I started, the regexp_matches() function was used with select. Thx! I saw that ~ and !~ were the operators, but I needed a syntactically correct example that could be used in aįilter expression. I'm interested in what you try to achieve here, do you want to share? BillGatesIII wrote:If you want to know if a string matches a pattern, use the ~ operator.Ĭoncat(card_1, card_2, card_3, card_4, card_5) ~ 'pattern'






Postgresql regex