-3

I have this string:

user__first=first; first__smth=smth; user__second=second; second__smth2=smth2

and I want some regex that matches for first__smth=smth;

or second__smth2=smth2 and I want it to match for things that do not only have these examples.

Sorry if it's easy or impossible, I'm very new to regex.

Vairoon
  • 9
  • 2
  • "I want it to match for things that do not only have these examples" What other examples are you thinking of? – Luuk May 31 '22 at 16:53
  • In order to write a regular expression, you must first express in English what the rules are that you're trying to match. The example are illustrative, but you have to define what the rules are. So what are the rules you want to use? – Andy Lester May 31 '22 at 17:01
  • something that doesn't start with "user" then __ and then a string of a non specified length, then equals sign, then another string without a specified length, and then a semicolon. – Vairoon May 31 '22 at 17:35
  • Welcome Vairoon! Have you tried anything yet and can you show your real input? [Regex101](https://regex101.com/r/rSdqFC/1) is a great playground for trying around with regexes. Also see the comprehensive [Stackoverflow Regex FAQ](https://stackoverflow.com/a/22944075/5527985) – bobble bubble May 31 '22 at 18:10
  • the real input can very well be as stated in the question, but so far I'm trying some crude stuff to get it working. – Vairoon May 31 '22 at 18:24

0 Answers0