Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
I need to match regex in javascript and ui5, or php?

I have some lengthy regex and I keep getting an error in ui5 webide and javascript using the replace function. I tried it in php using preg_replace and nothing happened. I am trying to remove the phone numbers and emails from the string "Feedback. (709)875-2711, 1(709)875-2711, uddalok.biswas@gmail.com hello.". Do I need to escape something? In php I am

Here is my regex for javascript and u5

/^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/g
/^\S+@\S+$/g
/^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/g
/(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$/g

Here is my regex for php

'/^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/'
'/^\S+@\S+$/'
'/^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$/'
'/(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$/'

The regex isn't doing anything in php and in ui5 controller I am using replace and getting an error unexpected token.

The expected result is the regex will match with phone numbers and emails in a large string either in php or javascript.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!