0

I am a complete regular expression idiot, just keep that in mind :)

I am trying to create a regular expression that will match link:xxxxxx where everything after link: is a wildcard.

Can i just do link:* or am I totally misguided?

Dylan Meeus
  • 5,696
  • 2
  • 30
  • 49
  • 1
    You can use `link:.*` – anubhava Aug 25 '16 at 09:34
  • "I am a complete regular expression idiot, just keep that in mind :)" -> ideally you should then take a tutorial or read documentation on the subject rather than ask people. Not only will it help maintain the quality of stackoverfow (you can't judge the quality of your question if you don't know the topic) but it will be much more effective for you in the long term. – Aaron Aug 25 '16 at 09:44
  • [A bit of reading material](http://stackoverflow.com/questions/22937618/reference-what-does-this-regex-mean) – LukStorms Aug 25 '16 at 09:46

1 Answers1

4

link:.* should work correctly. . matches any character, and you want to repeat it "0 to unlimited" times so you add *.

If you're new to regex, a good way to learn it is by using regex101.

For your problem, you can check out this regex101 example (Note that I have also added the g modifier, which means that you want to select all matches, not just the first matching line)

Dylan Meeus
  • 5,696
  • 2
  • 30
  • 49