regextasker

Check If first character is "+"


How can i detect string is start with "+"

I tried
^\s*?\+.*$
but no help.

P.s: I have only one line alltime.


Solution

  • You don't need \s*?, you have to use:

    ^\+
    or...
    ^[+]
    

    In case you want to check a complete string, you can use:

    ^\+.*$
    

    Working demo