0

Python regex pattern

pattern = r'^(?:(.*?) )?(https?:\/\/\S+) (.*)$|^(?:(.*?) )?(SERVER_UPLOAD_FILE_PATH____\S+) ?(.*)$'

how to convert this same regex into js regex ?

Any Help would be Appreciated thanks in Advance

0

1 Answer 1

0

I suggest you to read about RegExp validation before implementing https://www.w3resource.com/javascript/form/email-validation.php

and then try below code

var pattern = /^(?:(.*?) )?(https?:\/\/\S+) (.*)$|^(?:(.*?) )?(SERVER_UPLOAD_FILE_PATH____\S+) ?(.*)$/;
var string = 'test string';
// validate 
pattern.test(string)
Sign up to request clarification or add additional context in comments.

1 Comment

thanks @Nagesh Sanika for the help

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.