regex - Regular expressions in Kimonolabs -


kimonolabs have 3 part regular expression looks this:

/^()(.*?)()$/ 

first part preceeds desired text, middle part text want , third part follows desired text.

the text have is

"[usa] john doe" 

so guess, simple regex should give me want:

/^(\] )(.*?)()$/ 

but doesn't. when try more specific this:

/^(\[[a-z]{3}\] )(.*?)()$/ 

i guess not actual regex, more how kimonolabs regexes work.

the regex specified not match desired input. ^ @ beginning means line should start group follows in case expecting line start ].

to make pattern matching either:

  • get rid of ^ (which kimono not allow do)
  • or use regex: /^(.+\] )(.*)$/ matches characters followed ]

Comments