Skip to content
Subjects
Code examples
Library reference
Computer Programming
Python
Java
C++
C
Go
PHP
Kotlin
Ruby
R
Scala
Groovy
Rust
Dart
Mojo
Zig
Julia
Swift
C#
JavaScript
TypeScript
Tutorial menu
×
Subjects
Computer Programming
Maths
Planned
Chemistry
Planned
Lesson contents
Programming resources
All languages
Code examples
Library reference
Programming languages
Python
Java
C++
C
Go
PHP
Kotlin
Ruby
R
Scala
Groovy
Rust
Dart
🔥
Mojo
Zig
Julia
Swift
C#
JavaScript
TypeScript
Tutorials
/
Computer Programming
/
Library
/
PHP preg_replace
/
Other languages
preg_replace in other languages
Mask just the first locker number
Groovy
String.replaceFirst
Java
String.replaceFirst
Kotlin
Regex.replaceFirst
Python
re.sub
R
sub
Ruby
String#sub
Scala
String.replaceFirst