Regex to get all character to the right of first space? -


i trying craft regular expression match characters after (but not including) first space in string.

input text:

foo bar bacon 

desired match:

bar bacon 

the closest thing i've found far is:

\s(.*) 

however, matches first space in addition "bar bacon", undesirable. appreciated.

you can use positive lookbehind:

(?<=\s).* 

(demo)

although looks you've put capturing group around .* in current regex, try grabbing that.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -