in reply to Regular expression with capture following a match
You can use <code> and </code> tags around your data sample, and around the actual code that you have so far (not just the regex), and that will help others at the Monastery a lot.
Meanwhile, to capture the next full token of "non-whitespace" characters following the string "speed " in your example, try this:
Update: seeing davido's reply, I realize I misread the question -- he's right, you want to capture "(.*)" after "speed ", not just "(\S+)".if ( /speed (\S+)/ ) { $token = $1; # $token would be "basic-2.0" print "$token\n"; }
|
|---|