selecttextcharacterregular-language

Text between two characters


I'm trying with regular expression to select text between two () characters, complete with characters included.

EX. Text (the text) -> (the text) EX2. Text text text (the text again) -> (the text again)

I'm very noob at this and only have ()(.*) and ((.*)) 🙈 Thanks Mario


Solution

  • To find ( or ) chars, you need to escape it :
    \(.*\)
    But leaving as is .* , it will also take the closing parenthesis and will not stop when found.
    So you must search any number of chars except ^ closing parenthesis ):
    [^)]*

    Try this : \([^)]*\)