Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

regex to find blank lines (SIL)

Hi!

I need a regex to find blank lines in a field


i tried it but it doesn't work

if (matches(argv["cf_xxx],"^\s*"))

 

1 answer

First, what's the field, text field? If it's empty than the backend java value will be null. It doesn't store empty strings.

If it's just a single space " " then you don't want to use * as it means 0 or more occurrences, so it will always be a match regardless of the value.

Can you try "^\s+", where + means 1 or more?

 

According to https://www.baeldung.com/java-regex-s-splus the java syntax would be "\\s+" (which makes sense since it's in double quotes), not sure, one or two backslashes one of them should work though I assume. Probably the double backslash.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

512 views 1 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you