Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write regular expression validator in multiple line

Simon Chu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2024

I have texts in multiple lines, for example:

2023.11.12_16.37_AAA_BBBB

2023.11.12_16.37_AAA_BBBB

I am using the regex pattern "\d{4}.\d{2}.\d{2}\d.*?\w.*$" to check the format.

However, it only works for one line. Can anyone help me modify it to work with multiple lines?

1 answer

0 votes
Aron Gombas _Midori_
Community Champion
March 28, 2024

It slightly depends on the implementation you use, but generally in Java adding the "/s" modifier is the answer.

See: https://stackoverflow.com/a/159139

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events